Keeping variables through an error?

MHM

Registered User.
Local time
Today, 18:54
Joined
Mar 15, 2000
Messages
101
Is there any way declaring an OnErrorGoTo-command as default, i.e. this error-routine is used, when any code does not contain an OnError-statement?

I have worked a long time with finding a clue to this, cause all variables are emtied if only one error is not handled by an appropriate routine.

Now I normally store all valuable variables in a special form, where they are kept even if an error is not handled - but this is a rather difficult way and not a quick one as well.

Is there any other way not to loose variables?
 
The only way to not loose public variables when an error occurs is to trap every proceedure and have it call a reseting proceedure that re-declares your variables.

What I do is actually write a seperate Public Sub called 'ErrMsg'. By doing this I am able to Reset all variables that are pertinant at the time and it also standardizes my message that the user sees.

My main point is Error Trap every proceedure no matter what.

Hope this helps
 

Users who are viewing this thread

Back
Top Bottom