Controlling Combo Box contents by another Combo Box

  • Thread starter Thread starter Greg McLandsborough
  • Start date Start date
G

Greg McLandsborough

Say I have 3 tables "A" "B" & "C" which all have similar data to be
inserted in a cell. I want choose the Table from one combobox, and update
the contents of a second combobox to data from the selected table. What is
the best way of doing this. Any help is as alays greatly appreciated.

Regards

Greg
 
Say I have 3 tables "A" "B" & "C" which all have similar data to be
inserted in a cell. I want choose the Table from one combobox, and update
the contents of a second combobox to data from the selected table. What is
the best way of doing this. Any help is as alays greatly appreciated.

Regards

Greg

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.
 
Back
Top