I.e. Choose car from first dropdown. Then in second dropdown it gives you a list of cars. Once you choose a car, the third dropdown gives you options that only that car has etc etc.
This should give you an idea just drop this onto a new form dont change the name from form1 and put 3 comboboxes on the form. Its really basic but should show you how to do it.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Select Case ComboBox1.Text
Case Is = "Toyota"
ComboBox2.Items.Add("Tundra"
ComboBox2.Items.Add("Corolla"
ComboBox2.Items.Add("Camry"
Case Is = "Ford"
ComboBox2.Items.Add("F150"
ComboBox2.Items.Add("Mustang"
ComboBox2.Items.Add("MustangGT"
Case Is = "Nissan"
ComboBox2.Items.Add("PathFinder"
ComboBox2.Items.Add("B2200"
ComboBox2.Items.Add("Other Nissan Car"
End Select
End Sub
Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
Select Case ComboBox3.Text
Case Is = "Tundra"
ComboBox3.Items.Add("PowerLocks"
ComboBox3.Items.Add("Sun Roof"
ComboBox3.Items.Add("50 Cal Machine Gun"
Case Is = "Corrola"
ComboBox3.Items.Add("Wheels w/ spikes"
ComboBox3.Items.Add("Oil Slicks"
ComboBox3.Items.Add("20000 Year Warranty"
Case Is = "Camry"
ComboBox3.Items.Add("Alarm"
ComboBox3.Items.Add("Gold Trim Package"
ComboBox3.Items.Add("A/C"
Case Is = "F150"
ComboBox3.Items.Add("Tires"
ComboBox3.Items.Add("A Motor"
ComboBox3.Items.Add("Windows"
Case Is = "Mustang"
ComboBox3.Items.Add("Doors"
ComboBox3.Items.Add("Roll Cage.. but why???"
ComboBox3.Items.Add("Muddin Tires"
Case Is = "MustangGT"
ComboBox3.Items.Add("Low Pros"
ComboBox3.Items.Add("Spokes"
ComboBox3.Items.Add("Ubah System"
Case Is = "PathFinder"
ComboBox3.Items.Add("M&M's"
ComboBox3.Items.Add("Floor Mats"
ComboBox3.Items.Add("A Rear view mirror"
Case Is = "B2200"
ComboBox3.Items.Add("Seats"
ComboBox3.Items.Add("Air Bags"
ComboBox3.Items.Add("Side Air Bags"
Case Is = "Other Nissan Car"
ComboBox3.Items.Add("BackSeat Airbags"
ComboBox3.Items.Add("Roof Airbags"
ComboBox3.Items.Add("Airbags for the Airbags"
End Select
Well in that case you would first need to return a recordset of your first level choices. Then in combobox1.selectedindex change you would return another recordset based on the parameter you choose in combobox1.text. Then you would populate combobox2 like
Combobox1.selectedindexchanged
GetMyNewRecordSet2ndLayer passing combobox1.text as Parameter
Dim x as int16
For x = 0 to myNewRecordset.tables(0).rows.count - 1
And then the this will basically do the same thing for the next combobox, just passing combobox2.text as your parameter, and then loading the items into the combobox3.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.