In code I build a query via a string variable (strQuery).
I debug and print out and copy strQuery and paste it into SQL view of the query builder.
When I run the SQL in query builder I get 2 records returned....Perfect and what it is supossed to be.
When I run it in code via a recorset (Set rsRelationships = CurrentDb.OpenRecordset(strQuery)) and then debug print out the recordset.recordcount (rsRelationships.RecordCount) it = 12 records returned.
I even tried setting the recordset = nothing (Set rsRelationships = Nothing) and setting my string variable to be empty (strQuery = "") in the beginning.
What is going on? Why do I get one set of records in query builder and another set in code using the same string?
I debug and print out and copy strQuery and paste it into SQL view of the query builder.
When I run the SQL in query builder I get 2 records returned....Perfect and what it is supossed to be.
When I run it in code via a recorset (Set rsRelationships = CurrentDb.OpenRecordset(strQuery)) and then debug print out the recordset.recordcount (rsRelationships.RecordCount) it = 12 records returned.
I even tried setting the recordset = nothing (Set rsRelationships = Nothing) and setting my string variable to be empty (strQuery = "") in the beginning.
What is going on? Why do I get one set of records in query builder and another set in code using the same string?