The article you are referring implies that the SetToZero routine is called BEFORE you run the query. This could be accomplished with either a macro or vba code (perhaps behind a button on a form).
I cannot think of any way that it could be done within the query itself.
Is your sequence number intended to be globally unique, unique to the session or just unique within the recordset? Does your numbering need to be sequencial and incremental? Answering this will determine whether you need to reset the global variable, ignore the global variable, change the variable scope or think about something else altogether.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.