I am using this code to create a running total in MS Access 2000. It works great. However it only works once. After the query has been opened once It will keep adding the intcost to the gtotal starting from where it left off when the query was closed. Can you tell me how to make this a static code,where it will start with 0 every time the query is used. I have this query feeding another query that is feeding a report and the report may be run more then once a day, before access is closed and resets the query
Option Compare Database
Option Explicit
Global gTotal As Variant
Public Function Running_Total(intCost As Variant)
gTotal = gTotal + intCost
Running_Total = gTotal
End Function
You can always say tomarrow, but when you say yesterday, today is easier.
RBE
Our prayers go out to the WTC victims
Option Compare Database
Option Explicit
Global gTotal As Variant
Public Function Running_Total(intCost As Variant)
gTotal = gTotal + intCost
Running_Total = gTotal
End Function
You can always say tomarrow, but when you say yesterday, today is easier.
RBE
Our prayers go out to the WTC victims