Group Counting

  • Thread starter Thread starter Bill
  • Start date Start date
B

Bill

Ok I've look and for some reason I cant find. Maybe because its so simple
it's never been asked... :-)

I have a report that is grouping by "nature" then by "department". I need
to count the total number of items in the group "departmet". I've tried
=count(department) which produces nothing.

Also I need to create a report based on a search. For example if I only
want to know the nature that equals "fishing" then I want the report to
display only anything where nature is "fishing".

Thanks for the help
 
--
Dave Hargis, Microsoft Access MVP


Bill said:
Ok I've look and for some reason I cant find. Maybe because its so simple
it's never been asked... :-)

I have a report that is grouping by "nature" then by "department". I need
to count the total number of items in the group "departmet". I've tried
=count(department) which produces nothing.

Department has to be the name of a field in the report's record source
the expression need to be the control source in the group footer section for
the department group.
Also I need to create a report based on a search. For example if I only
want to know the nature that equals "fishing" then I want the report to
display only anything where nature is "fishing".

This you do when you open the report. You use the Where argument of the
OpenReport method. The example assumes you have a field in the report's
record source named nature

Docmd.OpenReport "MyReportName", , , "[nature] = """ & Me.txtNatureType
& """"

Where the control txtNatureType would be fishing or what ever you want to
filter on.
 
Back
Top