By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,880 Members | 1,382 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,880 IT Pros & Developers. It's quick & easy.

Summing in Page Footer w/ balanced brought forward from prev page

P: n/a
Access 2003 Report rptWhiteMailDeposit

I have found the "four lines of code" solution to adding sums to page
footers and it is working...mostly. (if report is only one page long it
doesn't count. Over two pages it works.)

In the rptWhiteMailDeposit I would like to have in the PAGE FOOTER of
each page the following:
Total Brought Forward (from previous page of report when report is
longer than 1 page)
Page Total (txtPageCashSum + txtPageChecksSum)
Grand Total (only displayed on last page of report. Sum of Page totals
to that point)

I've tried several things and inevitably the total brought forward on
page 2,3 etc. gets reset to zero when the pageheader print function
resets txtPageCashSum. A global variable solution perhaps? I can only
find a vague reference to a solution that used to work with Access

Here is the code I'm using. Any help would be appreciated. I am head of
non profit (The Salvation Army )in Covington, VA

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)

txtPageCashSum = txtPageCashSum + txtDonorCashAmmount
txtPageCheckSum = txtPageCheckSum + txtDonorCheckAmmount
End Sub

Private Sub PageHeaderSection_Print(Cancel As Integer, PrintCount As
txtPageCashSum = 0
txtPageCheckSum = 0

End Sub

FYI: May be effcting things:
Code for filter form that alters the content of this report on the fly:
Private Sub cboDateDonationEntered_MouseDown(Button As Integer, Shift
As Integer, X As Single, Y As Single)
ocxCalendar1.Visible = True
If Not IsNull(cboDateDonationEntered) Then
ocxCalendar1.Value = cboDateDonationEntered.Value
ocxCalendar1.Value = Date
End If

End Sub

Private Sub cmdApplyFilter_Click()

Dim strDonationDate As String
Dim strCampaign As String
Dim strFilter As String

If SysCmd(acSysCmdGetObjectState, acReport, "rptWhiteMailDeposit") <>
acObjStateOpen Then
DoCmd.OpenReport "rptWhiteMailDeposit", acViewPreview
End If

txtPageCashSum = 0
txtPageCheckSum = 0

If IsNull(Me.cboDateDonationEntered.Value) Then
strDonationDate = "Like '*'"
strDonationDate = "=#" & Me.cboDateDonationEntered.Value & "#"
End If

If IsNull(Me.cboCampaign.Value) Then
strCampaign = "Like '*'"
strCampaign = "='" & Me.cboCampaign.Value & "'"
End If

strFilter = "[SystemInputDate] " & strDonationDate & " AND
[DonorCampaign] " & strCampaign

With Reports![rptWhiteMailDeposit]
.Filter = strFilter
.FilterOn = True
.txtReportTitle.Value = "Name of Appeal: " &
.txtReportRunDate.Value = "Date: " &
End With
End Sub

Private Sub cmdCancel_Click()
DoCmd.Close acForm, "deposit report"
End Sub

Private Sub cmdRemoveFilter_Click()
On Error Resume Next
Reports![rptWhiteMailDeposit].FilterOn = False
End Sub

Private Sub ocxCalendar1_Click()
cboDateDonationEntered.Value = ocxCalendar1.Value
ocxCalendar1.Visible = False
End Sub

Aug 5 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.