InQuery2004
Registered User.
- Local time
- Yesterday, 22:01
- Joined
- Nov 12, 2004
- Messages
- 24
Greetings,
I am working with a data-entry form for my database. On this form, I would like to search a table in my DB with the current number entered in a textbox named txtEmpID. If the number is not found in the table, then the event will display a message telling the user to enter a valid employeeID or something to that effect. Although I thought that this would be a simple subroutine using DLookup I have been stuck for a few hours with bugs in this event. Here's my event procedure (copied and pasted):
Private Sub txtEMP_ID_LostFocus()
If (DLookup("[EMP_ID#]", "AssociateFixedInformation", "EMP_ID =" & Forms![AddNewProfile]!txtEMP_ID) = Null) Then
MsgBox "The EmployeeID that you have entered is for a non-existant Associate" _
+ " Please enter an EmployeeID for a current employee already in databas."
End If
End Sub
When I try to run the event, it generates some error saying that I cancelled the previous operation. What does that mean and more importantly, how can I get this operation to run on my form???
Thanks very much for the help
I am working with a data-entry form for my database. On this form, I would like to search a table in my DB with the current number entered in a textbox named txtEmpID. If the number is not found in the table, then the event will display a message telling the user to enter a valid employeeID or something to that effect. Although I thought that this would be a simple subroutine using DLookup I have been stuck for a few hours with bugs in this event. Here's my event procedure (copied and pasted):
Private Sub txtEMP_ID_LostFocus()
If (DLookup("[EMP_ID#]", "AssociateFixedInformation", "EMP_ID =" & Forms![AddNewProfile]!txtEMP_ID) = Null) Then
MsgBox "The EmployeeID that you have entered is for a non-existant Associate" _
+ " Please enter an EmployeeID for a current employee already in databas."
End If
End Sub
When I try to run the event, it generates some error saying that I cancelled the previous operation. What does that mean and more importantly, how can I get this operation to run on my form???
Thanks very much for the help
