Hi,
I am trying to pass a value from a combo box CboEmployee which is in a form called LogonForm to the combo box SBUCbo which is in a form called SBUForm. The idea is when someone selects his/her name is the CboEmployee I can do a dlookup to obtain the department where the person works and then that value is passed to SBUCbo when the form is opened. I am using the below code but it is not working.
DoCmd.OpenForm "SBUForm"
Forms!SBUForm!SBUCbo.Value = DLookup("[SBU_Name]", "Tbl_Employees", "[IDEmployee]=" & Me.CboEmployee.Value)
DoCmd.Close acForm, "LogonForm"
Just to say that IDEmployee is a number.
I was wondering if anybody could help
Thanks
Jose
I am trying to pass a value from a combo box CboEmployee which is in a form called LogonForm to the combo box SBUCbo which is in a form called SBUForm. The idea is when someone selects his/her name is the CboEmployee I can do a dlookup to obtain the department where the person works and then that value is passed to SBUCbo when the form is opened. I am using the below code but it is not working.
DoCmd.OpenForm "SBUForm"
Forms!SBUForm!SBUCbo.Value = DLookup("[SBU_Name]", "Tbl_Employees", "[IDEmployee]=" & Me.CboEmployee.Value)
DoCmd.Close acForm, "LogonForm"
Just to say that IDEmployee is a number.
I was wondering if anybody could help
Thanks
Jose