[RESOLVED] Access Report Totals = 0
Hi, I am trying to display a few column totals in the report footer and for some reason they are showing up as 0 every time. I am using the following code to calculate them:
VB Code:
Option Compare Database
Dim lPartyTotal As Long
Dim lHostessTotal As Long
Dim lSampleTotal As Long
Dim lKitTotal As Long
Dim lPieceTotal As Long
Dim lDollarTotal As Long
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
lPartyTotal = lPartyTotal + Me.Party_QTY
lHostessTotal = lHostessTotal + Me.Hostess_QTY
lSampleTotal = lSampleTotal + Me.Sample_QTY
lKitTotal = lKitTotal + Me.Kit_QTY
lPieceTotal = lPieceTotal + Me.Total_Piece_QTY
lDollarTotal = lDollarTotal + Me.Total_Dollar_Amount
End Sub
Private Sub Report_Open(Cancel As Integer)
lPartyTotal = 0
lHostessTotal = 0
lSampleTotal = 0
lKitTotal = 0
lPieceTotal = 0
lDollarTotal = 0
End Sub
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
Me.txtTotalParty = lPartyTotal
Me.txtTotalHostess = lHostessTotal
Me.txtTotalSample = lSampleTotal
Me.txtTotalKit = lKitTotal
Me.txtTotalPiece = lPieceTotal
Me.txtTotalDollar = lDollarTotal
End Sub
Anyone know what I am doing wrong?
Re: Access Report Totals = 0
I tried the code in ReportFooter_Print also....