Advertisement
ASP_Volume2 Debugging and Error Handling #32643

A QUICK AND EASY ERROR HANDLER!!!!!

In just a few easy lines you can a have a easy, error proof error handler for you apps! Plus, NO APIs!

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
''''IN MODULE!''''
Sub ErrHandler
ErrDesc = Err.Description
ErrNum = Err.Number
Beep
MsgBox "Error number " & ErrNum & " has occured because: " &_
ErrDesc, vbCritical, "Error"
Exit Sub
'Edit the msgbox all ya want to make it fit your needs
End Sub
'Ok, now to make my error handler work you need to
'add this right under the Sub...Examle:
Private Sub Command1_Click ()
'Now Here Is the code you need to add:
On Error Goto ErrHandle:
'Then put ALL your code for this Sub in as you would
'as usual, then at the end type:
ErrHandle:
Call ErrHandler
'AND THATS IT!
End Sub
Original Comments (3)
Recovered from Wayback Machine