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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count Number of Groups in a Report 1

Status
Not open for further replies.

MDTekUser

Technical User
Dec 25, 2005
68
0
0
US
What I would like to do is count the number of groups in a report and then display that in the report footer. I am able to do this with a dcount function but there has to be a way to do this within the report and without running an extra query.

Thanks...
 
Add a text box to your Group Header section:
Name: txtCountGroup
Control Source: =1
Running Sum: Over All
Visible: No
Add a text box to your Report Footer:
Control Source: =txtCountGroup


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Duane,

I tried that approach but it didn't work. It gave me a much higher number. Does the data type of the group section matter?

And Snyper, yes I can use DCount in a report. Just was trying to find another way to do this.
 
Ok, not sure what I did differently, but it works now. I like this solution better because it should allow the report to run more efficiently without haveing to open up an extra query through a DCcount function.

Thanks Duane.
 
Glad to hear it works for you. It will be more efficient compared to creating additional "recordsets" with DCount().

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I think what irritates me is that I have to constantly come on this site to find the answer to something. I feel I should be able to figure these things out myself.

I'm just being a copy cat.
 
I'm glad there are people like you here who are so willing to help. It sure makes my job a lot easier...thanks a million.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top