Hi,
i wanted to link options selected from Comb box A (general) to specific options in combo box B (specific). I want to pick a word in Combo box A that has specific words/phrases in Combo Box B show. But not all the words to show in the combo box B if they aren't associated with the Word picked in Combo Box A. Ex.When "Soda" is picked in A, only "Coke, Sprite, Fanta" should be visible in combo box b, not everything else.
This is the code i used to make the boxes, but i don't know how to link them. Do i use an If/Else/ Case Else statement or what?
Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' fills the combo boxes with values
Private Sub xGeneralComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles xGeneralComboBox.SelectedIndexChanged
Me.xSpecificComboBox.Enabled = True
Me.xSpecificComboBox.Items.Clear()
If Me.xgeneralComboBox.SelectedIndex = 0 Then
Me.xSpecificlComboBox.Items.Add("Sprite")
Me.xModelComboBox.Items.Add("Fanta")
Me.xModelComboBox.Items.Add("coke")
and it worked fine for just two things...i'm playing around with it to make it work for atleast 4 things in General Combo Box that can be selected then the values displayed in Combo box B....
.
Any ideas?
..
Private Sub xGeneralComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles xGeneralComboBox.SelectedIndexChanged
Me.xSpecificComboBox.Enabled = True
Me.xSpecificComboBox.Items.Clear()
If Me.xgeneralComboBox.SelectedIndex = 0 Then
Me.xSpecificlComboBox.Items.Add("Sprite")
Me.xModelComboBox.Items.Add("Fanta")
Me.xModelComboBox.Items.Add("coke")
and it worked fine for just two things...i'm playing around with it to make it work for atleast 4 things in General Combo Box that can be selected then the values displayed in Combo box B....
.
Any ideas?
..
I used the Case Select Statement and now it's all sorted out..
Bookmarks