combo boxes

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.
 
F

fredg

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top