I am assuming you have two tables where the data for both the combo boxes comes from. So you have a table tblMake which tracks the vehicle make, and another table tblModel which tracks the model of the vehicle against each make. tblMake would probably have a primary key, let's call it MakeID. Similarly tblModel could have a primary key, ModelID. Most importantly, tblModel must have a field MakeID which contains the appropriate MakeIDs to link the two records. A sample of data would look something like this:
The simplest you could do isCode:tblMake MakeID MakeName 01 Ford 02 Toyota tblModel ModelID MakeID ModelName 01 01 Focus 02 01 Taurus 03 01 Fiesta 04 02 Camry 05 03 Corolla
1. Load up the first combo box with data from the first table, tblMake.
2. Handle the SelectedIndexChanged event of the combo to retrieve the make the user has selected
3. Use the index above to load up the second combo box with relevant data from the second table, tblModel.
Steps 2 and 3 would go into the SelectedIndexChanged event handler.
.





Reply With Quote