I am develping a form for adding employees
I set the controls for firstname, middlename, lastname,hiredate (Is Not Null) in the table.
but in the form when I don't insert any field of those fields I definetly will get error number 3314 because I didn't insert the required fields
so I just want to write my custom message when I click save to be viewed for the user or at least when the user doesn't insert the required field
I used this code but it doesn't work as I want
Expand|Select|Wrap|Line Numbers
- Private Sub Form_Error(DataErr As Integer, Response As Integer)
- if an error occurs because of missing data in a required field
- 'display our own custom error message
- Const conErrRequiredData = 3314
- If DataErr = conErrRequiredData Then
- MsgBox ("Please ensure that you enter a First Name , Last Name , Middle Name and Hire Date ")
- Response = acDataErrContinue
- Else
- 'Display a standard error message
- Response = acDataErrDisplay
- End If
- End Sub
thanks in advance for any help you may provide me