summing a column

  • Thread starter Thread starter Anita
  • Start date Start date
A

Anita

Good Morning, I would like to sum a column of numbers for each page
separately in my report. The report is approx 7 pages long. I have a Grand
Total at the end of the report working well. I can get a running sum working
but I would like each page to have a page total.

Thanks for your help, Anita
 
Anita said:
Good Morning, I would like to sum a column of numbers for each page
separately in my report. The report is approx 7 pages long. I have a Grand
Total at the end of the report working well. I can get a running sum working
but I would like each page to have a page total.


There's nothing built in that makes it easy to do that so it
will take a little code.

Assuming you named your detail section RunningSum text box
txtRunAmt and your page footer text box that displays the
page total txtPageAmt, add another (hidden) text box (named
txtPageRunTotal) to the page footer section.

Then add a line of code to the Report Header section's
Format event:
Me.txtPageRunTotal = 0
and two lines of code to the PageFooter section's Format
event:
Me.txtPageAmt = Me.txtRunAmount - Me.txtPageRunTotal
Me.txtPageRunTotal = Me.txtRunAmount
 
Back
Top