[URGENT] Declaring an error handler like this... simple, but can someone help?
I want to declare an error handler like this if possible...
ErrorHandler:
Case err.number whatever
If err.description "whateverdescription" Then
MsgBox "do whateverdescription needs"
Else: MsgBox "a different error message"
Case err.number whateverelse
Msgbox "message for whatever else"
Case err.number yetanother
Msgbox "message for yetanother"
Case else
Msgbox "error handler to catch all other others not accounted for"
Can someone help me write it?
I've been trying it, but i keep either getting errors (like End Select declared in wrong place), or jumping errors and always going to the last one for some reason...
If anyone can please lend some help, please do.
Many thanks.
Re: [URGENT] Declaring an error handler like this... simple, but can someone help?
Quote:
Originally posted by VBKid04
I want to declare an error handler like this if possible...
ErrorHandler:
Case err.number whatever
If err.description "whateverdescription" Then
MsgBox "do whateverdescription needs"
Else: MsgBox "a different error message"
Case err.number whateverelse
Msgbox "message for whatever else"
Case err.number yetanother
Msgbox "message for yetanother"
Case else
Msgbox "error handler to catch all other others not accounted for"
Can someone help me write it?
I've been trying it, but i keep either getting errors (like End Select declared in wrong place), or jumping errors and always going to the last one for some reason...
If anyone can please lend some help, please do.
Many thanks.
Why are you asking the same question in multiple places?