G
Guest
I have read the previous posts that pertain to linking combo boxes, but I am
still confused. It seems as if every one does things very differently.
I have tow combo boxes that I want to link.
The first combo box is cmbsupervisor. In this combo box I am storing
supervisor ID numbers.
The second combo box is cmbemployee. In this combo box I aqm storing
employee ID numbers.
After selecting the supervisor I need the second combo box to only pull
those employees that belong to the supervisor.
Here are my table formats:
tblEmployee
Employee ID (autonumber)
Employee LName (text)
Employee FName (text)
Supervisor ID (linked to Supervisor ID in tblSupervisor)
tblSupervisor
Supervisor ID (autonumber)
SupervisorLName (text)
Supervisor FName (text)
The closest answer that I could find was the following...however I can't
figure out how to insert my information...
"Leave the rowsource of the 2nd combo box blank.
Code the AfterUpdate event of the 1st combo box to fill the rowsource
of the 2nd.
Something like this:
Combo2.Rowsource = "Select Instructors.InstructorID,
Instructors.InstructorName from Instructors Where Instructors.ClassID
= " & Me!ComboName & ";"
Change the table and field names as needed.
The above assumes ClassID is a Number datatype and the combo box bound
column is Number also.
still confused. It seems as if every one does things very differently.
I have tow combo boxes that I want to link.
The first combo box is cmbsupervisor. In this combo box I am storing
supervisor ID numbers.
The second combo box is cmbemployee. In this combo box I aqm storing
employee ID numbers.
After selecting the supervisor I need the second combo box to only pull
those employees that belong to the supervisor.
Here are my table formats:
tblEmployee
Employee ID (autonumber)
Employee LName (text)
Employee FName (text)
Supervisor ID (linked to Supervisor ID in tblSupervisor)
tblSupervisor
Supervisor ID (autonumber)
SupervisorLName (text)
Supervisor FName (text)
The closest answer that I could find was the following...however I can't
figure out how to insert my information...
"Leave the rowsource of the 2nd combo box blank.
Code the AfterUpdate event of the 1st combo box to fill the rowsource
of the 2nd.
Something like this:
Combo2.Rowsource = "Select Instructors.InstructorID,
Instructors.InstructorName from Instructors Where Instructors.ClassID
= " & Me!ComboName & ";"
Change the table and field names as needed.
The above assumes ClassID is a Number datatype and the combo box bound
column is Number also.