Page totals printing different from preview

proben930

Registered User.
Local time
Today, 09:11
Joined
Mar 22, 2004
Messages
30
I followed Q132017 to sum the totals for each page on my report. It works perfectly in preview. I have 3 I'm summing, so its slightly different. But for some reason when I print the report the totals come out different from what is previewed. Like the variables aren't resetting, even though I put that code in there. Here's the report code, help!

Dim x As Double
Dim x1 As Double
Dim x2 As Double
Option Compare Database

Private Sub PageFooterSection_Print(Cancel As Integer, PrintCount As Integer)
PageSum = RunSum - x
PageSum1 = RunSum1 - x1
PageSum2 = RunSum2 - x2
x = RunSum
x1 = RunSum1
x2 = RunSum2
End Sub

Private Sub Report_NoData(Cancel As Integer)
On Error GoTo exitsub

MsgBox ("There are no records available that match this criteria")
DoCmd.CancelEvent

exitsub:
End Sub

Private Sub ReportHeader_Print(Cancel As Integer, PrintCount As Integer)
x = 0
x1 = 0
x2 = 0
End Sub
 
Pat -
Thanks for the help. I figured the problem was something similar to that, but for the life of me I can't figure out where to place the code to make them reset to 0. I have it set when the report header prints, but apparently it needs to be somewhere else. TIA!
 
Anyone? Help :/
 

Users who are viewing this thread

Back
Top Bottom