Access Microsoft Access - Subtotals for each page

Joined
Jun 1, 2015
Messages
1
Reaction score
0
hi there, I'm using Access 2010

I'm trying to subtotal by page. There are no groupings in the report.
What I've done so far I got from article Q216311 ACC2000

'Entered into declarations:
Option Compare Database
Option Explicit
Public PageSum As Double​
'Entered code to the page heard on Formant property:
Private Sub Detail_Print(Cancel As Integer, FormatCount As Integer)
PageSum = PageSum + Reports![R_CloseAccts_toBeEscheated]![Assets]
End Sub​
'Entered code to the details section on Print property:
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)
' reset the counter for each new page
PageSum = 0​

Added textbox with the name: txtPageTotal
Control source = PageSum

My report runs, however the textbox shows the error: #Name?

Any help will be appreciated..
 
Back
Top