G
Guest
Here's the code:
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
Dim rs As DAO.Recordset
Set rs= CurrentDb.OpenRecordset("Select * From [MonthlyCash]",
dbOpenDynaset)
With rs
CashBal = DSum("[Cash]", "[MonthlyCash]", "[Sales Date] <= #12/31/05# ")
End With
MsgBox (CashBal) ' equals 500, SHOULD equal 1800 ??
Data in the Cash field of the [MonthlyCash] table:
11/22/05 800
12/2/05 200
12/15/05 300
12/18/05 500
1/5/06 700
1/9/06 900
2/1/06 400
the DSUM should total 1800, but it totals 1300. Any ideas?
(1. I want to show the CashBal value in the report. 2 The MonthlyCash
table is not the table that the report is based on)
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
Dim rs As DAO.Recordset
Set rs= CurrentDb.OpenRecordset("Select * From [MonthlyCash]",
dbOpenDynaset)
With rs
CashBal = DSum("[Cash]", "[MonthlyCash]", "[Sales Date] <= #12/31/05# ")
End With
MsgBox (CashBal) ' equals 500, SHOULD equal 1800 ??
Data in the Cash field of the [MonthlyCash] table:
11/22/05 800
12/2/05 200
12/15/05 300
12/18/05 500
1/5/06 700
1/9/06 900
2/1/06 400
the DSUM should total 1800, but it totals 1300. Any ideas?
(1. I want to show the CashBal value in the report. 2 The MonthlyCash
table is not the table that the report is based on)