Loss of Global Variables

  • Thread starter Thread starter kevin
  • Start date Start date
K

kevin

I have attempted to use global variables within an
application I am working on and have a problem with the
variables being blown away in the event of an error. Even
a planned error that is properly trapped will cause this
to happen. I then have to shut the application down and
restart to reset the variables. Why and how can I prevent
this. My solution to date is to put fields on a hidden
form that is always open. This works and I do not lose the
assigned values, but I would rather use variables in code.
 
kevin said:
I have attempted to use global variables within an
application I am working on and have a problem with the
variables being blown away in the event of an error. Even
a planned error that is properly trapped will cause this
to happen. I then have to shut the application down and
restart to reset the variables. Why and how can I prevent
this. My solution to date is to put fields on a hidden
form that is always open. This works and I do not lose the
assigned values, but I would rather use variables in code.


My understanding of this issue is that it should only occur with untrapped
errors. Also if you distribute an MDE to your users that should solve the
problem. I have seen other posts that indicate that MDE files do not lose
their global variable values upon errors the way MDBs do.

Otherwise your hidden form solution is a popular alternative.
 
Back
Top