3 Linked Combo Boxes

  • Thread starter Thread starter Jason Wills
  • Start date Start date
J

Jason Wills

Could anyone post me some code to use 3 linked combo boxes...

i have a single form and want three combo boxes to cascade down. all threee
combo boxes would be looking at the same table.

i am useless with code and just wondered if anybody could post some sample
code of what i should be using for all three boxes.

Thanx in advance

Jason
 
Please post more detail on what kind of data the three
boxes represent, and how you want the data input to work.
What do you mean exactly by "cascade down"? Do you want
the choices in the second dependent on the selected value
of the first, and the third dependent on the choice in the
2nd? Such as how a Country, State, County choice might
work?

Kevin Sprinkel
 
sorry for not explaining myself clearly, but you have the right idea,

what i need it for is to keep a record of software details on a computer -
they will represent: Operating Sysytem Software / Service Pack / License
Key. And i want to be able to select certain options in the second combo box
depending on the selection in the first, and to be able to select certain
options in the third combo box depending on selection in the second...

i have all these details listed in a table.


is this any clearer?

Jason
 
Hi Jason

In the AfterUpdate event of the first box, create a SQL statement to assign to
the
RowSource of the 2nd combo box, and then the third combo box, etc, etc.

Hope this helps

Maurice


Example:

Select Case Me.cboCategory
Case 3
Me.cboProduct.RowSource = "Select * From tblTable1;"
Case Else
Me.cboProduct.RowSource = "Select * From tblTable1 Where [Category]=" &
Me.cboCategory& ";"
End Select
 
Then Maurice has the answer. Set the Row Source for the
second combo box in the first's AfterUpdate event, e.g.,

Me!combobox2.RowSource =
"SELECT column1, column2, etc. FROM rowsourcetable & _
WHERE rowsourcetable.rowsourcefield = Me!combobox1;"

Similarly for the third. You can use the combo box wizard
to create the basic SQL, then add the WHERE clause to save
time and potential data input errors.

HTH
Kevin Sprinkel
 
Back
Top