Total Record Sum

archn01

Registered User.
Local time
Today, 19:57
Joined
Sep 19, 2002
Messages
14
Could someone tell me how i can show the total number of records within seperate queries in a form view. I have tried inserting a new 'count' field within the query but I don't know the formula to sum these.

Basically, the output I want is to show in a form just the total number of records in each query!

Thanks in advance!!
 
Just use the count function Count().

If you do not want to use the count function...you can add another field in your query and set the value to one. For each record in the query a 1 will appear for this field. Sum this column in your form and you will get a total for the number of records in your query.
 
Thanks for that but.....

Please excuse me for being simple, but how do I then sum the 'count' column within the form/query?
 
"Basically, the output I want is to show in a form just the total number of records in each query!"


Put a text box on the form. Set its Control Source as:
=DCount("*","yourQueryName")

You can also make it look like a label by setting:-
Enabled: No
Locked: Yes
Back Style: Transparent
Special Effect: Flat


Note.
If the table is large or the query is complicated, DCount() may take time to run the query behind the scenes.

It won't work if the query needs user input.
 

Users who are viewing this thread

Back
Top Bottom