J
James
The code below works and then goes to the employeeID field
when they enter the wrong emploeyy id. however if they
don't know a correct employeeid then they will keep
getting the error message unless they enter 'Esc'. Then
if they fill out any of the other fields the record will
update. I only want the record to update (or add) if the
employeeid is one from the table 'employee'. How do I
have the employeeid checked when the ok button is
pressed. Or what is the best way to do this? Thanks in
advance.
Private Sub EmployeeID_BeforeUpdate(cancel as integer)
If DCount("EmployeeID", "Employee", "EmployeeID =" & __
Me.EmployeeID) Then
Else
MsgBox "Enter a valid employee ID!", , "Invalid ID"
cancel = true
End If
End Sub
when they enter the wrong emploeyy id. however if they
don't know a correct employeeid then they will keep
getting the error message unless they enter 'Esc'. Then
if they fill out any of the other fields the record will
update. I only want the record to update (or add) if the
employeeid is one from the table 'employee'. How do I
have the employeeid checked when the ok button is
pressed. Or what is the best way to do this? Thanks in
advance.
Private Sub EmployeeID_BeforeUpdate(cancel as integer)
If DCount("EmployeeID", "Employee", "EmployeeID =" & __
Me.EmployeeID) Then
Else
MsgBox "Enter a valid employee ID!", , "Invalid ID"
cancel = true
End If
End Sub