I am trying to change the default error message "Object is invalid or no longer set" to a custome message.
This error occurs when a required data is blank in the record source of the form.
I have tried this but it does not work.
Any help would be appreciated.
This error occurs when a required data is blank in the record source of the form.
I have tried this but it does not work.
Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Const conErrRequiredData = 3420
If DataErr = conErrRequiredData Then
MsgBox ("One of the required number was not entered.Please enter the no. first.")
Response = acDataErrContinue
Else
'Display a standard error message
Response = acDataErrDisplay
End If
End Sub
Comment