This is the code I use to trap Form Error Codes:
The only issue that I am having is how do you trap the Error Description in a form error? I am already trapping the number but not the description.
Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
On Error GoTo err_handler
Response = acDataErrContinue
FormError "frmScheduled_Appts-Form_Error", DataErr, Screen.ActiveControl.Name
Exit Sub
err_handler:
CloseForm "frmGeneralError"
On Error GoTo err_handler2
FormError "frmScheduled_Appts-Form_Error", DataErr, Screen.ActiveControl.Name
Exit Sub
err_handler2:
FormError "frmScheduled_Appts-Form_Error", DataErr
End Sub
The only issue that I am having is how do you trap the Error Description in a form error? I am already trapping the number but not the description.