Hi THWatson
heres the answer to your questions:
1- it only happens with this report, its an invoice
2- if i send it directly to the printer there is no doubling
3- i think this is the code that is generating the issue but dont understand why!! heres the code:
Option Compare Database
Public PageSum, SommeMontantTotal, MontantTotAvTax, MontantTvq, MontantTps, MontantTotal As Currency
Private Sub Détail_Print(Cancel As Integer, PrintCount As Integer)
PageSum = PageSum + Me.SoutTotal
If Me.NoItem = "" Or IsNull(Me.NoItem) Then
Me.Vendant.Visible = False
Me.SoutTotal.Visible = False
Else
Me.Vendant.Visible = True
Me.SoutTotal.Visible = True
End If
End Sub
Private Sub Report_Open(Cancel As Integer)
SommeMontantTotal = 0
MontantTotAvTax = 0
MontantTps = 0
MontantTvq = 0
MontantTotal = 0
Me.etmtavtx.Visible = False
Me.mttotalavtx.Visible = False
Me.mttps.Visible = False
Me.mttvq.Visible = False
Me.mttotal.Visible = False
End Sub
Private Sub ZonePiedPage_Format(Cancel As Integer, FormatCount As Integer)
SommeMontantTotal = SommeMontantTotal + PageSum
If Me.Page = Me.Pages Then
'Cancel = True
Me.etmtavtx.Visible = True
Me.mttotalavtx.Visible = True
Me.mttps.Visible = True
Me.mttvq.Visible = True
Me.mttotal.Visible = True
MontantTotAvTax = SommeMontantTotal
MontantTps = Round(MontantTotAvTax * (0.07), 2)
MontantTvq = Round((SommeMontantTotal + MontantTps) * (0.075), 2)
MontantTotal = SommeMontantTotal + MontantTvq + MontantTps
Me.mttotalavtx = MontantTotAvTax
Me.mttps = MontantTps
Me.mttvq = MontantTvq
Me.mttotal = MontantTotal
SommeMontantTotal = 0
Else
Me.etmtavtx.Visible = False
Me.mttotalavtx.Visible = False
Me.mttps.Visible = False
Me.mttvq.Visible = False
Me.mttotal.Visible = False
End If
End Sub
Private Sub ZonePiedPage_Print(Cancel As Integer, PrintCount As Integer)
'SommeMontantTotal = SommeMontantTotal + PageSum
Me.mttotalavtx = 0
Me.mttps = 0
Me.mttvq = 0
Me.mttotal = 0
If Me.Page = Me.Pages Then
'Cancel = True
Me.etmtavtx.Visible = True
Me.mttotalavtx.Visible = True
Me.mttps.Visible = True
Me.mttvq.Visible = True
Me.mttotal.Visible = True
Me.mttotalavtx = MontantTotAvTax
Me.mttps = MontantTps
Me.mttvq = MontantTvq
Me.mttotal = MontantTotal
SommeMontantTotal = 0
Else
Me.etmtavtx.Visible = False
Me.mttotalavtx.Visible = False
Me.mttps.Visible = False
Me.mttvq.Visible = False
Me.mttotal.Visible = False
End If
End Sub
Thanks a lot!