I guess I provided the best answer to the wrong question. I had responded a
few days ago with a reply that assumed the OP was referencing the reports
record source there was no reply stating I was off base.
I was probably more concerned about the number of times I have seen OPs
looking for report record counts and being told that DCount() is the proper
solution when it clearly isn't.
--
Duane Hookom
MS Access MVP
"Steve" wrote in message
...
Look again at the OP's post. The report is not open with a where clause.
DLookup is based on a self-contained query with it's own criteria. DLookup
will certainly work!
Steve
"Duane Hookom" wrote in message
...
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
.