Hello
Is there a way to exit all running procedures with one command?
Sometimes a procedure(1) will call another procedure(2) which could call a
third procedure(3) and what I would like to do is give a command in
procedure(3) that would exit all three procedure without returning to
procedure(1) and procedure(2)
Example: I have hundreds of procedures and all of them call a function
(MyErrHandle) to handle any error that might happen during the procedure.
Private Sub Command0_Click()
On Error GoTo err_Handle
Exit Sub
err_Handle:
Call MyErrHandle
Resume Next
End Sub
Normally MyErrHandle will log the error and sometimes display a message and
then Resume Next upon returning from MyErrHandle. For certain errors,
however, I would like to exit the Command0_Click procedure instead of Resume
Next.
I know I could write the following code after Call MyErrHandle
Exit Sub
err_Handle:
Call MyErrHandle
If Err.Number = 3084 then
Exit Sub
Else
Resume Next
End if
End Sub
But if I could stop or exit the Command0_Click procedure from the
MyErrHandle or not return to Command0_Click from MyErrHandle it would save
me from going through all my hundreds of procedures and retype more error
handling codes.
Also the command has to not upset the functioning of the application to much
and requiring the application to be shut down and reopened.
I am using MSACCESS 2000
Thanks
G Gerard