I am trying to validate the fields in my database.I have already
validated the fields to check for not null.Here is what I have written
for Numeric and text field.
Private Function EENUM()
On Error GoTo EENUMErr
If IsNull(Me.EmployeesID) Or Me.EmployeesID = "" Or Me.EmployeesID
< 0 Then
MsgBox "Employee Number Cannot Be Left Blank", vbOKOnly,
"Employee Number"
EmployeesID.SetFocus
End If
EENUMErr:
If Err <> 0 Then
MsgBox "Error #: " & Err.Number & " Description: " &
Err.Description, , "Employee ID Error!"
Exit Function
End If
End Function (This checks for nulls values in the employee number
field)
I want to add a message if a text field is entered in this field And I
want to put up a message if the user enters more than 4 digits.I have
already set the field length to 4 at the design time
And I have written the following for the text field.
Private Function EFN()
On Error GoTo EFNErr
If IsNull(Me.FirstName) Or Me.FirstName = "" Then
MsgBox "Enter Employees First Name", vbOKOnly, "First Name"
FirstName.SetFocus
End If
EFNErr:
MsgBox "Error #: " & Err.Number & " Description " & Err.Description, ,
"First Name Error!"
Exit Function
End Function
This checks for nulls in the Employye field and I want to add a
message if user enters anything other than text.
Can anyone help me with this?
Thanks