below is my code:
Sub MyFirstConnection()
Dim con1 As ADODB.Connection
Dim recSet1 As ADODB.Recordset
Dim strSQL As String
Dim strsearch As String
strsearch = "ACI"
strSQL = "SELECT CorpDesc FROM rollup" & _
" WHERE Company = " & " '" & strsearch & "'"
Set con1 = CurrentProject.Connection
Set recSet1 = New ADODB.Recordset
recSet1.Open strSQL, con1
Do Until recSet1.EOF
Debug.Print recSet1.Fields("CorpDesc"), recSet1.Fields("Completed")
recSet1.MoveNext
Loop
recSet1.Close
con1.Close
Set con1 = Nothing
Set recSet1 = Nothing
End Sub
Sub MyFirstConnection()
Dim con1 As ADODB.Connection
Dim recSet1 As ADODB.Recordset
Dim strSQL As String
Dim strsearch As String
strsearch = "ACI"
strSQL = "SELECT CorpDesc FROM rollup" & _
" WHERE Company = " & " '" & strsearch & "'"
Set con1 = CurrentProject.Connection
Set recSet1 = New ADODB.Recordset
recSet1.Open strSQL, con1
Do Until recSet1.EOF
Debug.Print recSet1.Fields("CorpDesc"), recSet1.Fields("Completed")
recSet1.MoveNext
Loop
recSet1.Close
con1.Close
Set con1 = Nothing
Set recSet1 = Nothing
End Sub