Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count of Group Header in Report Footer 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

I'm trying to do a total count of companyies in the report footer, but cannot get it to work.

I've created a hidden field which is equal to 1 and is placed in the CompanyName grouping header.

Then in the report footer I've tried to do
Code:
=sum([Text33])
but it just creates an error.

How can I count number of company group headers as a footer total?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
It's ok, found the workround as it isn't actually possible.

You need to do the math yourself via the group header 'print' event.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
You must set the Running Sum property of the text box in the Group Header section to Over All. Then rename your text box to something like "txtGroupCount" which is much better. Add a text box to your report footer and set its Control Source to:
=txtGroupCount


Duane
Hook'D on Access
MS Access MVP
 
Interesting Duane, I wonder why the info I found said you had to go round the houses using VBA and the print event to gather the info yourself.

I'll try what you suggest and see if I come up with the same results.



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Very odd as it is Microsoft who say it isn't possible...

here is the link i found


here is a snippet from that page
Placing sums in the page header or footer

Sometimes you want to calculate a total for each page of a report. The page footer and header sections, however, do not support calculated controls that use aggregate functions such as Sum. You can solve this problem with a little understanding of how reports work in Access, and a small amount of Microsoft Visual Basic® for Applications (VBA) code. VBA is the programming language that Access uses.





"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
got ya! many thanks, amazing how one word can make all the difference.

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top