Hello all
I have a single form that needs to load different datasets into a list box from a main menu. This works fine until i go back and select a dataset prevously selected as the list box duplicates the enteries again and again. I have tried to clear the listbox upon the menu click but to no avail.I would be very gratefull anyone could advise. I have include the code im using which works upon one selection but duplicates on return.
Many thanks
I have a single form that needs to load different datasets into a list box from a main menu. This works fine until i go back and select a dataset prevously selected as the list box duplicates the enteries again and again. I have tried to clear the listbox upon the menu click but to no avail.I would be very gratefull anyone could advise. I have include the code im using which works upon one selection but duplicates on return.
VB.NET:
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
OleDbDataAdapter1.Fill(DataSet14)
ListBox1.DataSource = DataSet14.ANATOMY
ListBox1.DisplayMember = "EXAMINATION"
ListBox1.ValueMember = "IMAGEPATHjpeg"
DataGrid1.DataSource = DataSet14.ANATOMY
End Sub
Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
OleDbDataAdapter2.Fill(DataSet21)
ListBox1.DataSource = DataSet21.FRACTURES
ListBox1.DisplayMember = "EXAMINATION"
ListBox1.ValueMember = "IMAGEPATHjpeg"
DataGrid1.DataSource = DataSet21.FRACTURES
End Sub
Last edited by a moderator: