For some reason, before the selectedindexchanged sub routine finishes, combobox Description is still pointing on the last selectedindex changed and the combobox Image is on the actual current selected index changed. Once it exits the routine both combobox are in the current value.

I cant see why this is happening, causing a lot of trouble.

Private Sub Connection()
    con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Test\Database1.accdb"
    Dim ds As New DataSet
    Dim dt As New DataTable
    Dim da As New OleDb.OleDbDataAdapter
    da = New OleDbDataAdapter(databasetable, con)
    dt.DefaultView.Sort = "Item ASC"
    cmbItem.DataSource = dt
    cmbItem.DisplayMember = "Item"
    cmbImage.DataSource = dt
    cmbImage.DisplayMember = "Image"
    cmbDescription.DataSource = dt
    cmbDescription.DisplayMember = "Description"
    cmbFeatures.DataSource = dt
    cmbFeatures.DisplayMember = "Performance Feature"
    cmbOptions.DataSource = dt
    cmbOptions.DisplayMember = "Options"
End Sub

Private Sub cmbItem_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles                    cmbImage.SelectedIndexChanged
    dirDescription = cmbDescription.Text
    pcbCatalog.ImageLocation = cmbImage.Text
End Sub

to add more, what I would like is to have one "Mother" combobox, and the rest of the combobox to change their selectedindex to the one that the Mother combobox has.

What do u actually want to do in ur coding???

set the combo box value for 1 combox and then on the selection change event get the remaining values....

if I am wrong then can you be little more clear....

This article has been dead for over six months. Start a new discussion instead.