I have a combobox that is bound to a DB and works great. However, when the user adds a value to the table to which the combobox is bound, the combobox keeps the old value and adds the current items in the table. In this case the table originally held just one record ("2012"). The user added 2013 so the table now shows two records ("2012" and "2013"), but the combobox shows three records ("2012", "2012", and "2013"). UNTIL I exit the app and restart, in which case it correctly reflects the only two records in the table ("2012" and "2013"). I have tried cboYear.Datasource = Nothing, cboYear.items.clear, cboYear.DataBindings.clear and nothing works. Here is the code.
Try Dim asql As String = ("SELECT * FROM YearsAvailable ORDER BY CurrentYear") Dim da As New OleDbDataAdapter(asql, con) da.Fill(ds) cboYear.ValueMember = "CurrentYear" cboYear.DataSource = ds.Tables(0) cboYear.SelectedIndex = 0 CurrentYear = cboYear.Text Me.Text = "MSD of Perry Township Compensation Model: " & CurrentYear 'cboYear.Refresh() Catch ex As Exception MsgBox("ERROR filling the YEAR control: " & ex.Message.ToString) End Try