Print Problem

G

Guest

I'm calculating page totals in a report using:

Private Sub PageFooter_Print(Cancel As Integer, PrintCount As Integer)
PageSumOrderPrice = RunSumOrderPrice - x
x = RunSumOrderPrice

PageSumCCCharge = RunSumCCCharge - c
c = RunSumCCCharge

PageSumVariance = RunSumVariance - v
v = RunSumVariance
End Sub

Private Sub ReportHeader_Print(Cancel As Integer, PrintCount As Integer)
x = 0
v = 0
c = 0
End Sub

This works well, but when I actually print the report, the wrong totals come
up (ex: page 1 onscreen is $430 but when printed out page 1 total is
-$13,205.38.

?? Please help - tx.
 
A

Alex Dybenko

Hi,
Print can occure more then once, use FormatCount to check this:

Private Sub Detail_Print(Cancel As Integer, FormatCount As Integer)
If PrintCount = 1 Then
RunningTotal = RunningTotal + OrderAmount
End If
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top