Query Form dujoint

bknight
BronzeLounger
Posts: 1391
Joined: 08 Jul 2016, 18:53

Query Form dujoint

Post by bknight »

I have a query with a form using that query as source.

Code: Select all

SELECT Int(([NinjaTrader2024].[Time])) AS Tradedate, NinjaTrader2024.Instrument, Sum(NinjaTrader2024.Profit) AS [Daily P_L], Sum(Abs([Quantity])) AS [#Trades], Sum([commission]+[fees]) AS Com_Fee
FROM NinjaTrader2024
WHERE (((Day([NinjaTrader2024].[Time]))=Day(Now())) AND ((Month([NinjaTrader2024].[Time]))=Month(Now())))
GROUP BY Int(([NinjaTrader2024].[Time])), NinjaTrader2024.Instrument, Year([NinjaTrader2024].[Time]), NinjaTrader2024.Account_display_name
HAVING (((Year([NinjaTrader2024].[Time]))=Year(Now())));
The query runs and displays values assumed to be correct. I was going to create a new query based on the above I had a Comm&Fees as name of the sum field, well that didn't work so I renamed it Com_Fee as above. I believed the form would reflect the change and the form does, however the form does not display data for that field but a #Name? in all that field.
The image is of the form design. Any suggestions since the query displays all data?
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78506
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Query Form dujoint

Post by HansV »

What happens if you select the Control Source of that text box again?
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1391
Joined: 08 Jul 2016, 18:53

Re: Query Form dujoint

Post by bknight »

It has as its control Cum_Fee.

User avatar
HansV
Administrator
Posts: 78506
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Query Form dujoint

Post by HansV »

OK, but did you try to clear the Control Source, then select it again?
Best wishes,
Hans

bknight
BronzeLounger
Posts: 1391
Joined: 08 Jul 2016, 18:53

Re: Query Form dujoint

Post by bknight »

No but I will.

bknight
BronzeLounger
Posts: 1391
Joined: 08 Jul 2016, 18:53

Re: Query Form dujoint

Post by bknight »

That didn't work either, so I deleted the form and re-created. It works now just like the query.
Thanks

User avatar
HansV
Administrator
Posts: 78506
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Query Form dujoint

Post by HansV »

Sometimes you have to do that, sadly. At least you've got it working now.
Best wishes,
Hans