Littlemalky
Board Regular
- Joined
- Jan 14, 2011
- Messages
- 223
Hi, I'm using Access 2010. I have a form with two combo boxes: one is for the employee ID and the other is the employee name. I want the user to be able to input the employee ID (if they know it) and have the employee name populate after update in the employee name combo box. Alternatively, if the user doesn't know the employee ID, I'd like the user to select the employee name and have the employee ID populate after update in that corresponding combo box.
First, I'm just starting with employee ID selection to see if I can get this to work. The DLookup is working correctly. I tested it by setting a msgbox to return the results. However, the value the msgbox returns is not populating in the combo box for some reason. Any ideas?
<!--
First, I'm just starting with employee ID selection to see if I can get this to work. The DLookup is working correctly. I tested it by setting a msgbox to return the results. However, the value the msgbox returns is not populating in the combo box for some reason. Any ideas?
Code:
Dim varX As Variant
varX = DLookup("EMPLOYEE_FULL_NICK_NAME", "tbl_EMPLOYEE_COST_CENTER_MAP", "EMPLOYEE_ID = '" & Forms![frm_SALES_EMPLOYEE_MANAGEMENT]!cmbEMPLOYEE_ID & "'")
Me.cmbEMPLOYEE_NICKNAME = varX
<!--
Code:
-->