I have a function that performs a running sum calculation. It has a public variable to store the value.
I call the function from a query to generate a running balance calculation. It works fine the first time. But if I close it and run the query again it is wrong because the calculation value begins where the last one left off.
The problem is because the previous amount remains leftover in my public variable. So I do I reset this variable to zero?
(yes, I know you can do running sums in reports but I would like to learn this programming technique).
Thanks in advance,
Dwight
I call the function from a query to generate a running balance calculation. It works fine the first time. But if I close it and run the query again it is wrong because the calculation value begins where the last one left off.
The problem is because the previous amount remains leftover in my public variable. So I do I reset this variable to zero?
(yes, I know you can do running sums in reports but I would like to learn this programming technique).
Thanks in advance,
Dwight