|
-
Sep 16th, 2003, 02:50 AM
#1
Thread Starter
Lively Member
Error$
Hi i was wonderinging if there is a way to capture all errors in a module or something.
i want to have a general error for example.
on error goto GenError
code
exit sub
GenError:
msgbox err.source & " " & err.description
then on every sub proceedure in my application all i have to do is call upon this.
Any Help You can give me would be great.
-
Sep 17th, 2003, 05:13 PM
#2
Member
Hello,
Maybe this is a sollution to your problem?
Private Sub Command1_Click()
On Error GoTo fout
Open "a:\testfile.xyz" For Input As #1
Close 1
Exit Sub
fout:
'Here you call the function.
ShowErrMessage Err
End Sub
'This sub you can put in a module
Public Sub ShowErrMessage(myError As ErrObject)
MsgBox Err.Number & " " & Err.Description, vbOKOnly + vbCritical, "Error:"
End Sub
greets,
J@b@r
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
|