Viewing The Output Of SQL Statements (i.e. "Debug.Print")

lhooker

Registered User.
Local time
Today, 07:38
Joined
Dec 30, 2005
Messages
423
The following SQL statements run with no errors, but I can't see the output of the SQL statements. What is wrong with my "Debug.Print" or "rs" statement ? I would like to see the results. The SQL statements works when I save them to a query. Thanks ! ! !


Dim db As DAO.Database
Dim rs As DAO.Recordset
Rem Dim intResult As Integer
Dim strSQL As String

Set db = CurrentDb

strSQL = "SELECT Table_Payee_List.PayeeSelectBox, Table_Category_List.Category FROM Table_Payee_List INNER JOIN (Table_Category_List INNER JOIN Table_Payee_Category_Junction ON Table_Category_List.CategoryID=Table_Payee_Category_Junction.CategoryID) ON Table_Payee_List.PayeeSelectBox=Table_Payee_Category_Junction.PayeeSelectBox " & _
"WHERE (((Table_Category_List.Category) = ""710A-College Students""));"

Set rs = db.OpenRecordset(strSQL, dbOpenSnapshot)

intResult = rs
Debug.Print

rs.Close
db.Close
 
JDraw,

The "Debug.Print strSQL" prints the SQL code. I want to print the results of the SQL statements. The reference material states that I use rs.Fieldname (i.e. "rs.Table_Category_List.Category", but get an error (i.e. "Method or data member not found"). I'm using a "Function" table, so I think I have to reference table and column name . . . Right ? Please see code above. Thanks ! ! ! :banghead:
 
JDraw,

I found the mistake . . . It was a typo. Thanks ! ! ! :o
 
Members of the Recordset's Fields Collection can be accessed with the bang operator. A dot does not work.

rs!fieldname
 

Users who are viewing this thread

Back
Top Bottom