0

Hello Everyone, I have a task that invlolve two or more comboboxes, simply put I want a combobox that is populated with state of a country and another with cities in the state.I know I have to populate from Database which isnt a problem. Now to populate the state combobox I have this Private function.

Private Sub StatePopulateCombo(ByVal cbox As ComboBox)
        cbox.Items.Add("Newyork")
        cbox.Items.Add("California")
        cbox.Items.Add("Texas")
        cbox.Items.Add("Montana")
        cbox.Items.Add("Michigan")
        cbox.Items.Add("Oregon")
        cbox.Items.Add("Arizona")
End Sub

and will call this up for every combobox I want to populate with the state of the country

StatePopulateCombo(ComBoxState)

Now I want another Funtion or sub that will populate another combobox with cities of each state based on state selected from the previous combobox.

Thank you in aniticipation.

2
Contributors
2
Replies
7
Views
2 Years
Discussion Span
Last Post by ibpet11
0

Basically, you'll want to handle the SelectedIndexChanged event of the combobox holding the state names. The method for handling this event will allow you to add the code to change the contents of the other combobox.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.