count groups

  • Thread starter Thread starter GBA
  • Start date Start date
G

GBA

I know the count() method to count records....but am drawing a blank as to
whether there is a method to count groups....

i.e. the name appears on every record...I have grouped by name.... I would
like to count the number of unique names (i.e. groups)....but a Count(Name)
gives the count of all records....

any solution?
 
As I understand you - that would be a query based solution outside the report.

No way to do within report?
 
GBA said:
I know the count() method to count records....but am drawing a blank as to
whether there is a method to count groups....

i.e. the name appears on every record...I have grouped by name.... I would
like to count the number of unique names (i.e. groups)....but a Count(Name)
gives the count of all records....


Add a text box (named txtCount) to either the group header
or footer section. Set the text box's control source to =1
and RunningSum to Over All.

Then a report footer text box can display the total by using
the expression =txtCount

If you do not have a group header or footer, create one and
make it invisible.
 
If you are grouping by name then add a textbox control (txtCountNames) to the
group level and set its source to =1 and set it to count overall.

In the report footer, add another control (txtTotalCountNames) and set its
source to =[txtCountNames]

You can set the visible propery of txtCountNames to false (No) to hide it from
view when printing.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
aha - - I get it....thanks all.



Marshall Barton said:
Add a text box (named txtCount) to either the group header
or footer section. Set the text box's control source to =1
and RunningSum to Over All.

Then a report footer text box can display the total by using
the expression =txtCount

If you do not have a group header or footer, create one and
make it invisible.
 
Back
Top