Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cascading Combo Box

Status
Not open for further replies.

jkslc

Technical User
Nov 23, 2003
4
0
0
US

Hello, I was wondering if someone could please help me with the following??? Lets say you have (2)comboboxes on a form which in turn are tied to a database, I would like to have a user select data from the first combobox, and the second box would have data filtered by what was selected in box #1. Example: Box 1 has Ford, Dodge, and Chevy. When a user selects Chevy, box two would have only cars made by chevy (Corvette, Camaro, Malibu, etc...) but if that same user goes back to box 1 and changes it to Ford, box 2 would have cars made by Ford (Mustang, T-Bird, etc...). You could take it even further by selecting the type of car (sportscar, suv, pickup etc....) I'm sure this is a easy solution. I thank you in advance...

 
if they are filled using a dataset or datatable then you would just put a dataview on the corresponding table.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
chrissie1,
thank you for your response, could you please give a newbie a little more info. thank you
 
Hi

Populate the first conbo box with your first set of data.
When the combo box is clicked use the event to populate the second combo box based the value that was selected

ddlCombo1_SelectedIndexChanged (Event)

ddlCombo1.SelectedValue becomes the parameter to your next query to populate the second combo box.

Rember to use

ddlCombo2.ClearSelection() first otherwise the sub items will keep adding

Good luck
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top