How can I retrieve the results of the below SQL code ? Also, How can I replace the hard coded 'Target' value with the variable named 'Account' ?
Dim strSQL As String
Dim rs As DAO.Recordset
Account = [List7].[Column](0)
strSQL = "SELECT Bill_Name, Last_Paid, NextPaymentDate FROM Bills " & _
"WHERE [Bill_Name] = 'Target'"
Debug.Print strSQL
Set rs = CurrentDb.OpenRecordset(strSQL)
If Not (rs.EOF) Then
Debug.Print rs![Bill_Name]
Else
Debug.Print "Nothing found"
End If
Set rs = Nothing
Dim strSQL As String
Dim rs As DAO.Recordset
Account = [List7].[Column](0)
strSQL = "SELECT Bill_Name, Last_Paid, NextPaymentDate FROM Bills " & _
"WHERE [Bill_Name] = 'Target'"
Debug.Print strSQL
Set rs = CurrentDb.OpenRecordset(strSQL)
If Not (rs.EOF) Then
Debug.Print rs![Bill_Name]
Else
Debug.Print "Nothing found"
End If
Set rs = Nothing