combo boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to know if there is a way to put 2 comboboxes on a form and in
the first combo box have a list of items and when one of those items is
picked the 2nd combo box changes it's list to what items go with that
selection you pick in the first combobox. Any help would be great. Thanks.
 
I would like to know if there is a way to put 2 comboboxes on a form and in
the first combo box have a list of items and when one of those items is
picked the 2nd combo box changes it's list to what items go with that
selection you pick in the first combobox. Any help would be great. Thanks.

Leave the rowsource of the second combo box blank.

Code the AfterUpdate event of the first combo box to load the second.

Here is some generic sample code:

Combo2.Rowsource = "Select TableName.RepName from TableName Where
TableName.CompanyID = " & Me!Combo1 & " Order By RepName;"

Selecting the Company in the first combo box will then fill the second
combo with the Company RepNames of only that company.

The above assumes the bound column of Combo1 is a Number datatype.
 
Back
Top