Show number of records returned in a parameter query.

jojo

Registered User.
Local time
Today, 18:03
Joined
Jul 20, 2012
Messages
51
I am trying to use Dcount to find the number of records in a query and put it on a text box in the header of a report. The query is a parameter query. The button opens a form which asks for start and end dates, the query reads those dates from the form and the report displays the correct number of records that fall within the date range. The query is based on another query, which is based on the table. I tried =dcount("*","qryName") but I get #error. Maybe becauase of dates? or parameters?
any help would be greatly appreciated.
access 2010. windows 7
Thank you so much.
 
Code:
=dcount("*","qryName")
Should work, but is qryName actually the name of your query :confused: If not replace it with the actual name of the query involved.
 
Just wondering, if the report is based on the Query that uses the parameter.. Then would a simple
Code:
=Count(*)
not work?

I also think this might be cause of the error??
 
thank you, BigJohn Booty for your answer on 3/11 which I only saw now, because your reply went into the spam folder for some reason! Yes, you are right: I have 2 queries with similar names, and was using the wrong query name....which happens when noviecs work late into the night against deadlines. Thank you for your reply! This great forum has provided answers not only to my specific posted questions, but I have also found answers to other questions way back in 2008 that applied to what I was trying to do.
Jojo
Thank you again.
 

Users who are viewing this thread

Back
Top Bottom