This won't work if you open the report with a where condition that filters
the records displayed in a report. I almost always use code like:
Dim strWhere as String
strWhere = "[DateField] Between #" & me.txtStart & "# AND #" & Me.txtEnd & "#"
DoCmd.OpenReport "rptMyReport", acPreview, , strWhere
Using DCount() will not understand the where condition so it is very
possible the displayed value will be greater than the actual number of
records returned in the report.
--
Duane Hookom
Microsoft Access MVP
"Steve" wrote:
Hello Ray,
DCount("*","NameOfYourQuery") will give you the number of records in
NameOfYourQuery. Add an unbound textbox to your report and put =
DCount("*","NameOfYourQuery") in the control source.
Steve
"swansonray" wrote in message
...
Hi all,
In the detail section of a report I want to display the number of records
a
query returns.
Example query named "support"
In the report I want to display Support = "number of records in query"
and then continue with the number of records in other querys with
different
names.
Thank you for your assistance.
Ray Swanson
Lemoore, CA
.