|
-
Jan 7th, 2000, 02:23 AM
#1
Thread Starter
Lively Member
Hi, everybody!
I’m dealing with errors using the command:
=====================
On error goto MyError
=====================
but I have the same module to deal with errors from various buttons.
I’ve tried to create a private sub called Private Sub MyError() and to call it from the various buttons, using the command:
=====================
On error call MyError
=====================
but it doesn’t work. I’ve tried to create just a Label called MyError, outside any Private Sub, but it doesn’t work either.
If I use the command - On Error Resume Next – it works ok with the error, but I’d like to be able to send the user a Msgbox also.
Any ideas on how to avoid creating a MyError label with the same commands in all the buttons click events?
Thanks in advance,
Roselene
-
Jan 7th, 2000, 03:24 AM
#2
In MyError in each routine, call a common error routine like so...
MyError:
If Err.Nbr > 0 Then
MyCommonErrorRoutine
End If
In my code I pass the name of the calling routine to the common error routine so that it can be displayed within the error message.
------------------
Marty
-
Jan 10th, 2000, 12:33 PM
#3
Thread Starter
Lively Member
Martin,
Thanks very much! It works!
I'll try to pass some information of the calling routine to the common error in order to let the user know about what he should do.
Best regards,
Roselene
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|