I am trying to make the Control Source for a textbox a lookup function. I don't understand why it isn't working...
=DLookUp("[EmployeeFirstName]","dbo_EmployeeNumber","[EmployeeNumber]= '" & [Me]![CONTACTLOCATION_ENTEREDBY_QCEMPLOYEE_ID] & "'")
I am trying to make the Control Source for a textbox a lookup function. I don't understand why it isn't working...
=DLookUp("[EmployeeFirstName]","dbo_EmployeeNumber","[EmployeeNumber]= '" & [Me]![CONTACTLOCATION_ENTEREDBY_QCEMPLOYEE_ID] & "'")
Is EmployeeNumber Text or a numeric field type?
If numeric, get rid of the quotes and you can't use ME in a control source. So if it is numeric and not a text field it would be:
=DLookUp("[EmployeeFirstName]","dbo_EmployeeNumber","[EmployeeNumber]= " & [CONTACTLOCATION_ENTEREDBY_QCEMPLOYEE_ID])
Perfect! That works.
I thought that you needed the ' when it is a numeric data type...the same as a WHERE clause for SQL.