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"
con.Open()
Dim ds As New DataSet
Dim dt As New DataTable
ds.Tables.Add(dt)
Dim da As New OleDb.OleDbDataAdapter
da = New OleDbDataAdapter(databasetable, con)
da.Fill(dt)
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"
con.Close()
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