Hi,
I am in the process of cleaning up my code as it has been a bit buggy to say the least . Currently I am using error handling for some of my subs, although I have read pretty much everywhere that it should be in all subs. As I have many subs per form, would it be wise to call error handling instead of putting
on every sub? Would be very interested to see what the responses are on this one.
I am in the process of cleaning up my code as it has been a bit buggy to say the least . Currently I am using error handling for some of my subs, although I have read pretty much everywhere that it should be in all subs. As I have many subs per form, would it be wise to call error handling instead of putting
Code:
Private Sub DoSomething()
' Install the error handler.
On Error GoTo UnexpectedError
' Do stuff.
:
' Do not pass through into the error handler code.
Exit Sub
UnexpectedError:
' Describe the error to the user.
MsgBox "Unexpected error" & _
Str$(Err.Number) & _
" in subroutine DoSomething." & _
vbCrLf & _
Err.Description
Exit Sub
End Sub