G
Guest
HI.....I have gone to google to check for code to count unique records in a
report.
I used the following suggestion:
A.) Use a counter in VBA to count how many times you hit the group header.
This is pretty simple. You dimension a variable: intSchoolCount as Integer
in the reports General Declarations. In the Report Header On Print Event,
add code:
intSchoolCount = 0
In the Group Header On Print event, increment the school count with code
like:
intSchoolCount = intSchoolCount + 1
Last in the section of the report that contains the control where you want
to display the total number of schools, set the control source for the
control to be empty. Then in the On Print event of that section add code:
Me!YourControlName.Value = intSchoolCount
My problem is I need to count the values by grouping. This gets me a total
count. Is there a way to count by each grouping? To use this example, say
the schools were grouped by private and public and they needed a count for
each group.
Hope this makes sense.
Thanks for your help!
report.
I used the following suggestion:
A.) Use a counter in VBA to count how many times you hit the group header.
This is pretty simple. You dimension a variable: intSchoolCount as Integer
in the reports General Declarations. In the Report Header On Print Event,
add code:
intSchoolCount = 0
In the Group Header On Print event, increment the school count with code
like:
intSchoolCount = intSchoolCount + 1
Last in the section of the report that contains the control where you want
to display the total number of schools, set the control source for the
control to be empty. Then in the On Print event of that section add code:
Me!YourControlName.Value = intSchoolCount
My problem is I need to count the values by grouping. This gets me a total
count. Is there a way to count by each grouping? To use this example, say
the schools were grouped by private and public and they needed a count for
each group.
Hope this makes sense.
Thanks for your help!