Works in Report Header/Footer or Group Header/Footer (as advised to use in post #4), not Page Footer.
If you want to aggregate each page, review https://answers.microsoft.com/en-us/...c-014c06374408
I have this code behind report in my db:
Code:
Option Compare Database
Option Explicit
Public intPageCount As Integer
Public intPageTotal As Integer
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
' increment intPageCount and intPageTotal for each record printed
intPageCount = intPageCount + 1
intPageTotal = intPageTotal + Nz(Me!Qty, 0)
End Sub
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
'set the textboxes in footer
Me.tbxPageCount = intPageCount
Me.tbxPageTotal = intPageTotal
'reset our counters
intPageCount = 0
intPageTotal = 0
End Sub
Difference is I don't set RunningSum property on UNBOUND textboxes in Page Footer. Maybe I should but report is only 1 page and have not tested for multiple pages.