Hi,
I have the following code;
At run time, I click the button and it works ok. Th ereason I inserted the code in BOLD is to refresh the combo box (CmbTruckTyp) and retain the selectedIndex by reading it again from TxtTruckTyp.Code:Private Sub BtnChk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnChk.Click 'TODO: This line of code loads data into the 'ProductDetails.QryProductDetails' table. You can move, or remove it, as needed. Me.QryProductDetailsTableAdapter.Fill(Me.ProductDetails.QryProductDetails, TxtTruckTyp.Text, TxtModel.Text, TxtCategory.Text) Me.TblTruckTypeTableAdapter.Fill(Me.TruckTyp.TblTruckType) CmbTruckTyp.SelectedIndex = CmbTruckTyp.FindStringExact(TxtTruckTyp.Text) End Sub
Reason why I am doing this is because at run time if I do multiple selection from the combo box the value keep duplicating itself in the dropdownlist and I wanted to avoid that.
The problem am facing now is no duplication, however, at when I click the button the cmbTruckTyp becomes blank until you select again. ie.,
doesnt take effect..Code:CmbTruckTyp.SelectedIndex = CmbTruckTyp.FindStringExact(TxtTruckTyp.Text)
Any help please
thanks


Reply With Quote