Global declaration string variables reset conditions?
Posted on 2012-09-18
I have a small VBA application that uses a global declaration module to hold string values for form names and report names. These are used to make the code more readable and maintainable but I am running into an issue outside of the development environment where these strings appear to reset spontaneously.
I was operating on the premise that global variable resets would only occur in these cases:
1 When the user presses End after a runtime error
2 When you click the stop button on the debugging toolbar
3 When you're in step mode and you close the VBE and click OK to stop debugging
4 When the code passes an End statement.
Unless the code is corrupted, none of these conditions should occur in production. All routines have error handlers and the VBA editor environment is not user accessible.
What other conditions may result in global variables being reset? At the time the error showed up the application was being used normally and did not experience any other preceding errors.