Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting records on a report

Status
Not open for further replies.

flybravo

Programmer
Jun 30, 2003
35
US
Firs off, I hope this is the right forum to be posting this question.

I have a report that has four other subreports in the report. I need to be able to count the number of records based on an inspectorsID at the top of the page, for each sections and show the number at the bottom of the main reports?
 
Hi, on each subreport create a text box and set the control source to =Count(*)
 
Nowell's suggestion is right on but if you have multiple inspectorID's on each subreport that have to be counted you may need something like this as the control source for your textbox.

=Sum(IIf(InspectorID = 1234,1,0))

This will give you a count for that specific inspector. Then you would create separate textboxes for each InspectorID.

Paul
 
Paul, thanks for your input.
Could you tell me the difference between an IIF statement and an IF statement?
 
The IIf statement is actually an Access built in function and the If..Then statement is a VBA condtional statement. They basically work the same way. They evaluate a condition and then branch to the appropriate response. The difference is where you can use them. You can use an IIf() function directly in the Control Source for your textbox where you can't use the If...Then statement. That needs to be placed in a module and used within the VBA framework.
Hope that helps.

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top