this is what i have been using to populate the combo box from form load.but i decided to put it into a sub procedure to call it in the INSERT statement.
Code:
PublicSub UpdateComboBox1()
Dim conn = New OleDbConnection(conn1)
Dim ds1 AsNew DataSet()
Dim dt As DataTable
Dim dr As DataRow
da1.Fill(ds1)
cboYearlyStuff.Items.Clear()
'Repeat for each table in the DataSet collection.
ForEach dt In ds1.Tables
'Repeat for each row in the table.
ForEach dr In dt.Rows
Dim strMyJoin AsString
strMyJoin = (dr("Yearly_ID")) & " - " & (dr("TheYear")) & " - " & (dr("MyClass"))
cboYearlyStuff.Items.Add(strPupilJoin)
Next
Next
EndSub
it works when i call it from form load,but wont work for subsequent "callings"
Code:
Sub YearlyForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
UpdateComboBox1()
EndSub
Bookmarks