I have a form load sub routine here and the problem is that the program executes the first one (namely, LoadProgrammes()
) and then skips the rest of the subroutine. There is something about the subroutine LoadProgrammes()
that makes the rest of "Form Load" not get called.
The same goes for ListActiveClasses()
. Only DisplayGroups()
is called properly and the next line of code is called.
I literally have no idea why and it is extremely difficult to find a google solution. Thanks in advance to whomever can help.
Private Sub frmEnroll_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
LoadProgrammes()
ListActiveClasses()
DisplayGroups()
End Sub
Private Sub LoadProgrammes()
Dim strLoadSQL As String
Dim dsLoad As New DataSet
Dim daLoad As OleDb.OleDbDataAdapter
Using con As New OleDbConnection(My.Settings.ConnectionPath)
strLoadSQL = "SELECT Programme FROM Programmes"
daLoad = New OleDb.OleDbDataAdapter(strLoadSQL, con)
daLoad.Fill(dsLoad, "LoadProgrammes")
'Add items to the combobox
For i = 0 To dsLoad.Tables("LoadProgrammes").Rows.Count
cmbProgramme.Items.Add(dsLoad.Tables("LoadProgrammes").Rows(i).Item(0))
Next
End Using
End Sub