Group Counting

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
 
K

Klatuu

--
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top