H
HuskerJeff
I am trying to put a rolling total in an access report. I need to put it in
the page hader, footer, and on each line. I think I want to make it a public
variable, but when I do that, it looks like this:
Option Compare Database
Public curRollBalBen As Currency
Public curRollBalGen As Currency
Public curRollBalSoc As Currency
Public curRollBalBld As Currency
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
curBrtForBen = curRollBalBen + BReceipts - BExpenditures
curBrtForGen = curRollBalGen + GReceipts - GExpenditures
curBrtForSoc = curRollBalSoc + SReceipts - SExpenditures
curBrtForBld = curRollBalBld + BuildReceipts - BuildExpenditures
CurDetBalBen = curBrtForBen
CurDetBalGen = curBrtForGen
CurDetBalSoc = curBrtForSoc
CurDetBalBld = curBrtForBld
End Sub
Then I get an error "The expression onformat you have entered as the event
property setting produced the following error: can't execute code in design
mode.
If I dim it in one of the subs, I can't set it public, but if I set it
private, everything runs but the value is not carried to the other modules.
What am I doing wrong?
the page hader, footer, and on each line. I think I want to make it a public
variable, but when I do that, it looks like this:
Option Compare Database
Public curRollBalBen As Currency
Public curRollBalGen As Currency
Public curRollBalSoc As Currency
Public curRollBalBld As Currency
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
curBrtForBen = curRollBalBen + BReceipts - BExpenditures
curBrtForGen = curRollBalGen + GReceipts - GExpenditures
curBrtForSoc = curRollBalSoc + SReceipts - SExpenditures
curBrtForBld = curRollBalBld + BuildReceipts - BuildExpenditures
CurDetBalBen = curBrtForBen
CurDetBalGen = curBrtForGen
CurDetBalSoc = curBrtForSoc
CurDetBalBld = curBrtForBld
End Sub
Then I get an error "The expression onformat you have entered as the event
property setting produced the following error: can't execute code in design
mode.
If I dim it in one of the subs, I can't set it public, but if I set it
private, everything runs but the value is not carried to the other modules.
What am I doing wrong?