Counting Subgroups (access xp)

  • Thread starter Thread starter tom
  • Start date Start date
T

tom

Hi All,

I have a Access report with 2 levels of grouping:

* Group 1: Company
* Group 2: Department
* Detail: Person

In the header of group 1, I would like to show a count of the number
of group 2's within group 1. In other words, for ACME Widgets, I want
to see that this report contains data for 3 Departments.

Is this possible?

Thanks,
-Tom

sample:
========================
ACME WIDGETS. 3 Departments
* Design Department
- Joe
- Fred
* Packaging Department
- Mary
- Mark
* Fun Department
- Bozo
MINICORP. 1 Department.
* Super Department
- Al
- Mary
- Sam
- Joe
- Bill
- Theresa
 
You can create a separate totals query that Groups By Company and
Department. Name the query "qgrpCoDept". Then create another totals query
based on qgrpCoDept that Groups By Co and Counts Department. Save this query
and add it to the record source of your current report. Join the Company
fields and drop your CountOfDept into the query grid so you can display it
in the report.
 
Hi Tom,

Thank you for using MSDN Newsgroup! It's my pleasure to assist you with
your issue.

To show the amount of department within a company in your report, another
thinking could be: In the Company Header, you have an Text. You have a
global variable x, the original value is 0. In the event of
GroupHeader1_Format ( in my test it is for the grouping of the department
), x=x+1. In the event of GroupHeader0_Format ( Which is the grouping of
Company), the Text you want to show the number of Department will be set to
x, and then x will be reset to 0 for next company.

Hope this helps. For any more questions, please feel free to post new
message here and I am ready to help!

Best regards

Baisong Wei
Microsoft Online Support
 

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

Back
Top