I am trying to call an error handler in module from a form. What is the correct syntax to call it?
Printable View
I am trying to call an error handler in module from a form. What is the correct syntax to call it?
Code:'bas module code for errors
Public Sub GetErrorSub()
If Err.Number = 19 Then
'
Else
MsgBox Err.Number
End If
End Sub
'
'form event code
Private Sub Command1_Click()
On Error GoTo errHandle:
'bla bla bla
'bla bla bla
'bla bla bla
'leave disk out to generate an error
Dir ("a:\")
Exit Sub
errHandle:
GetErrorSub
End Sub
first, you must check it the error handler function is not private.
if it's public you can simply type the name of the function and give the paramters or you can specify the module name. eg
errhandle param1, param2, param3
or
modulename.errhandle param1, param2, param3
Apple
Thanks for the help!