B
Big B
Hi There
I have been trying lot to calculate running sum on calculate field...
Below is my code but static variable doesnt get initialise when I
re-run query..And its also mess up when i click on running sum field or
scroll down or up query result...
query..
Dum: qryRunSum()
RunSum: qryRunSum([Result])
'Please note that [Result] is calculated field based on other fields of
query..
Public Function qryRunSum(Optional arg As Variant) As Double
Static lastrunsum As Double
If IsMissing(arg) Then
lastrunsum = 0
Else
lastrunsum = lastrunsum + arg
End If
qryRunSum = lastrunsum
End Function
Any help would be appreciated
Thanx in advance...
I have been trying lot to calculate running sum on calculate field...
Below is my code but static variable doesnt get initialise when I
re-run query..And its also mess up when i click on running sum field or
scroll down or up query result...
initialise static variable to zero but it doesnt work when i re-runFrom query i have two additional columns ..First column is just to
query..
Dum: qryRunSum()
RunSum: qryRunSum([Result])
'Please note that [Result] is calculated field based on other fields of
query..
Public Function qryRunSum(Optional arg As Variant) As Double
Static lastrunsum As Double
If IsMissing(arg) Then
lastrunsum = 0
Else
lastrunsum = lastrunsum + arg
End If
qryRunSum = lastrunsum
End Function
Any help would be appreciated
Thanx in advance...