I found this code from a post several months ago:
QUERY defined new column named CumTot passing Fcast as parameter:
CumTot: CalcCumTot([Fcast])
FUNCTION in a module assumes long value in and out:
function CalcCumTot(iValue as long) as Long
Static new CumTotal as long
CumTotal = CumTotal + iValue
CalcCumTotal = CumTotal
end function
I applied it to my query and it works great. However, each time I run the query, all of the numbers in the Fcast column are greater than the previous time I ran the query. Only when I quit Access completely then come back in and run the query does it reset.
If only I could figure out how to solve this...please help. Thanks in advance.
QUERY defined new column named CumTot passing Fcast as parameter:
CumTot: CalcCumTot([Fcast])
FUNCTION in a module assumes long value in and out:
function CalcCumTot(iValue as long) as Long
Static new CumTotal as long
CumTotal = CumTotal + iValue
CalcCumTotal = CumTotal
end function
I applied it to my query and it works great. However, each time I run the query, all of the numbers in the Fcast column are greater than the previous time I ran the query. Only when I quit Access completely then come back in and run the query does it reset.
If only I could figure out how to solve this...please help. Thanks in advance.