Sub LoopDatabaseLeague() On Error GoTo LoopDatabaseLeagueError SQLstr = "SELECT Name, LeagueType_ID From League Where League.[LeagueType_ID] = '2';" myEmailFolder = "" Set KA_RS_League = New ADODB.Recordset If KA_RS_League.State = adStateOpen Then KA_RS_League.Close <<< State = 0 KA_RS_League.Open SQLstr, KA_DB, adOpenDynamic, adLockOptimistic <<< This line skips to the end Do Until KA_RS_League.EOF KA_Which_Newsletter.ComboBox1.AddItem (KA_RS_League![Name]) If FindString(mySubject, KA_RS_League![Name]) Then myEmailFolder = KA_RS_League![Name] End If KA_RS_League.MoveNext Loop KA_RS_League.Close LoopDatabaseLeagueError: End Sub
On Error GoTo LoopDatabaseLeagueError
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)