Tip of the Month: October 2007
Microsoft Access: Calculate the percentage of records in a group
Although it's easy to count the number of records in a group, determining that
number's percentage of the report's overall record count may not seem easy to
do. Fortunately, it's easy to calculate the percentage.
- Add a textbox control to the report's Detail section and name
it txtCountAll.
- Set its Visible property to No
- Set its Control Source property to =Count(*)
- Add a textbox control the group footer and name the new control txtCountGroup
- Set its Visible property to No
- Set its Control Source property to =Count(*)
- Add another textbox to the group footer and name it percent.
- Set its Control Source property to =txtCountGroup/txtCountAll.
- Set its Format property to Percent.
If you have any questions regarding this tip or need help implementing it in
your own projects, contact Ranelle
Maltas at 472-0585 or rmaltas2@unl.edu.
