0

I have a database with a table called BREAKFASTMILK
Inside the table I have Two Columns named MENU and FOOD ITEM

when using this code if I change the index of one of comboboxes it will change the index of the other.


I want to keep both independent but get their data from the same table.

With frm.cmbSUBRmeMilk
            .DataSource = sundaydata.get_menuBRMILK.Tables("BREAKFASTMILK")
            .DisplayMember = "MENU"
            .ValueMember = "MENU"
            .SelectedIndex = 0
        End With

 With frm.cmbSUBRfiMilk
            .DataSource = sundaydata.get_menuBRMILK.Tables("BREAKFASTMILK")
            .DisplayMember = "FOOD ITEM"
            .ValueMember = "FOOD ITEM"
            .SelectedIndex = 0
        End With

Thanks for your help

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by ninjatalon
0

try this if it works.. put it in an SelectedIndexChanged Event

Private Sub cmbSUBRmeMilk_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbSUBRmeMilk.SelectedIndexChanged


        cmbSUBRfiMilk.SelectedIndex = cmbSUBRmeMilk.SelectedIndex
End Sub
0

try this if it works.. put it in an SelectedIndexChanged Event

Private Sub cmbSUBRmeMilk_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbSUBRmeMilk.SelectedIndexChanged


        cmbSUBRfiMilk.SelectedIndex = cmbSUBRmeMilk.SelectedIndex
End Sub

That what i'm trying to prevent. for some reason it does that

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.