Domac said:
Hi,
When exception (debug or End) occur
all of my global variable resets!
How to prevent it??
Generally, this happens only with "unhandled errors," so a good start would
be to include error handling everywhere an error could happen. That will
cover many of the cases, but it may be difficult to determine _all_ the
possibilities. If it's a production application used by others, it should
have user-friendly error handling, in any case. If it's your own
application, then you can live with losing the globals, or use another
option for storing them than global (Public) variables in a standard module.
Some other options are: save critical values in Controls on a
hidden/invisible Form; save the critical values in a Table; save critical
values in Properties of the database.
Larry Linson
Microsoft Access MVP