Run a stored(saved) Select Query and Sum a few columns

Lateral

Registered User.
Local time
Yesterday, 19:28
Joined
Aug 28, 2013
Messages
388
Hi guys,

I have many existing saved Select Queries that are attached to either a form or report. If they are attached to a Form, I have a text box with the following in the Control Source to total a column:

=Sum("[Parts Total]-nz([Total Payments])")

All of this works well and these queries are used to generate important management style reports and data.

What I want to do is create a new single form called fSnapShot that will display a range of totals based upon numerous existing saved queries.

I have tried to figure this out but can't crack it.

I can count the number of records in a query by doing the following:

Me!tThanksCount = DCount("*", "qAll Valid Workorders Money Not Owing - Thanks")

But how do I use VBA to run the query and do the equivalent of :

=Sum("[Parts Total]-nz([Total Payments])")

Thanks for any help you can provide.

Cheers
Greg
 
Hi guys

I just figured it out!

The following is all that I needed to do...

Payments = DSum("[Total Payments]", "qAll Valid Workorders Money Owing_01")

Cheers
Greg
 

Users who are viewing this thread

Back
Top Bottom