Hi
I am using Access 2000.
I have searched this site for all the "error handling" threads. However, I still can't get them to work. For instance, in the OnError event of my form I included:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
If DataErr = 3314 And IsNull(Me.ChartNo) Then
MsgBox "Chart Number is a required field"
Me.ChartNo.SetFocus
Response = acDataErrContinue
Else
Response = acDataErrDisplay
End If
End Sub
However, it still shows me the Access error and not my message. What am I doing wrong? Also, some of the threads talk about creating an error subroutine. What would code for that look like and how would I call it (I haven't ever used a sub or function!).
Thanks so much!
Shelby
I am using Access 2000.
I have searched this site for all the "error handling" threads. However, I still can't get them to work. For instance, in the OnError event of my form I included:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
If DataErr = 3314 And IsNull(Me.ChartNo) Then
MsgBox "Chart Number is a required field"
Me.ChartNo.SetFocus
Response = acDataErrContinue
Else
Response = acDataErrDisplay
End If
End Sub
However, it still shows me the Access error and not my message. What am I doing wrong? Also, some of the threads talk about creating an error subroutine. What would code for that look like and how would I call it (I haven't ever used a sub or function!).
Thanks so much!
Shelby