counting records shown in a report

B

Becky

greetings to all

I have a report bound to a query called qAttendance. The report has its
Filter property set to limit the records showing in the Detail section. So
far so good.

In the report footer, i want to show the count or records in the report.
How do I do this?? (I can get a count in forms using recordsetclone and
bookmarks, but I can't figure out a good method for reports)

Becky
 
D

Duane Hookom

DCount() is not a reliable choice since your report may be opened with a
Where Condition which filters the records. DCount() would not be aware of
this filter. In addition DCount() opens another recordset which takes
resources.

The preferred method is to simply add a text box in the Report Header or
Report Footer sections with a Control Source of:
=Count(*)

This will always be a true count of the records in your report.
 
G

glj011848

Just for future reference...place a text box in the detail band of your report...fill it with a 1 (just a 1).
Set the property of the text box so it will do a running total. Now, you can count any group, or total by referencing that text box. Where you reference will determing the total you get! Works great. You can keep the text box hidden for appearance sake.

Hope this helps...someday.






ref: http://codeconnect.net/microsoft-news.access-reports/counting-records-shown-in-a-report
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top