Count groups

KenHigg

Registered User
Local time
Today, 11:39
Joined
Jun 9, 2004
Messages
13,327
I have a simple report that groups on part_number and in the detail shows multiple records for part_number. How do I count how many groups the are (Hence how many different part numbers there are)?

Thanks for anyone's help - :)
 
Last edited:
Ken - You should be able to use the QBE grid to select the part number twice, click the grouping button and leave the first one as Group By and then set the other to Count and it should give you the count of the part number.
 
Hum... I understand doing that in a totals query but my report is based on a simple table with multiple fields. Not sure where or how to bring in a second totals query...?
 
Or, if you have the ability in your report to group by part number then you can just make sure to have a text box in the header or footer with =Count([YourPartNumberField]) in there.

If that doesn't work, then creating a sub report with the query I suggested might be the way to go and then put it in the particular footer you want.
 
Thanks - I suppose I could use your second suggestion. I was hoping for a little more simple solution...

Ken :)
 
Unbound textbox in Group footer, set control source to =1, set running sum property to overall
 
Thanks Rich - That's real close. That gives me a running total of the groups in the group footer but I just need the value in the last group footer in the report header - ?
 
Unbound textbox in Group footer, set control source to =1, set running sum property to overall

I did this and it worked fine. I just set it to not visible and then in the report footer I created a text box with a control source set to the name of the unbound textbox. It only showed up in the report footer and the total was correct.
 

Users who are viewing this thread

Back
Top Bottom