When the total is reset, note the highest record number in the table using RECCOUNT(). Only adjust the total when the current record number, returned by RECNO(), is greater than the record count noted when the running total was cleared.
>I have a client that needs a resettable running total on an input form that will be used for comparison purposes during input. They will start it at 0 and as they input values, it will increase and decrease accordingly. When they are done inputting a sheet of entries (paper), they compare it and then reset it for the next page.
>
>I was adding a textbox on the form and a reset button to handle this with routines in the appropriate LOSTFOCUS methods for the field(s) that control this amount.
>
>This all works in logic except when they go back and edit a record that may have not been in this batch of entries or from a previous "page". I am not 100% sure how I can ensure that this doesn't effect the running total. Example, say the runtot is at $100... they go back to an entry from a previous "page" and change the amount from $40 to $50. The routine would normally, subtract the $40 and then add $50 for a net change of +$10. The only problem is the original $40 was NOT in the total and the new $50 should NOT be added to the running total.
>
>Suggestions?
"Ignorance more frequently begets confidence than does knowledge."
-- Charles Darwin
"I am invincible! Invincible...OWWWWWWWW!"
-- Homer Simpson