Autopopulate form on change

csdrex87

Registered User.
Local time
Today, 09:05
Joined
Jul 1, 2009
Messages
66
I searched this forum for autopopulating but nothing really seemed exactly like i'd like it to happen. What im trying to do is once the user is done changing the information i.e. his name... it will autopopulate the ID from the information in a table. Im currently using the onchange event of that particular item in the form.

Dim iOMDID As String
If IsNull(Me.EmployeeName) = False Then
iOMDID = DLookup("[OMD_ID]", "tblEmployeeID", "[EmployeeName] = " & Me.EmployeeName)
Me.OMD_ID = iOMDID
End If

Is what i have so far in there and when i test it it gives me an error message saying syntax error Missing Operand in "[EmployeeName] = " & Me.EmployeeName. As it is probably just me not parsing correctly any help?
 
iOMDID = Nz(DLookup("[OMD_ID]", "tblEmployeeID", "[EmployeeName] = " & Chr(34) & Me.EmployeeName & Chr(34)),"")
 
Thanks that works perfectly.
 

Users who are viewing this thread

Back
Top Bottom