DSum on query different than recordsource

danikuper

Registered User.
Local time
Yesterday, 23:17
Joined
Feb 6, 2003
Messages
147
Can I use a Dsum function in a control box in my report and point the Dsum to a query that is not the recordsource for the report?

I tried the following in a text box in my report:

=DSUM("[quota]","qryQuota_Qtr")

I get #error as result... this qryQuota_Qtr is not the query in my recordsource.

Is there any other way to get that?

Thanks!!!!
daniel

=Access 2K=
 
A possibility... have you tried opening qryQuota_Query in the background before opening the report? That might work.
 
Kraj, that will not help at all. The report runs the query within the DSum() every time it needs to print the line that contains that control.

danikuper, Make sure the query name is spelled correctly, make sure that the query works outside of the DSum(), make sure that the control name is not the same as the name of one of the columns from the report's recordsource. For example, if you have a column named SomeAmt, you CANNOT use the name SomeAmt as the Name of a calculated control.
 
I'll try that.
Thanks, Pat.

:)
Pat Hartman said:
Kraj, that will not help at all. The report runs the query within the DSum() every time it needs to print the line that contains that control.

danikuper, Make sure the query name is spelled correctly, make sure that the query works outside of the DSum(), make sure that the control name is not the same as the name of one of the columns from the report's recordsource. For example, if you have a column named SomeAmt, you CANNOT use the name SomeAmt as the Name of a calculated control.
 
Pat Hartman said:
Kraj, that will not help at all. The report runs the query within the DSum() every time it needs to print the line that contains that control.
Good to know.
 

Users who are viewing this thread

Back
Top Bottom