I have a command button on an Access 2010 Form that populates a recordset and sets the form filter based on the results. The recordset is opened with the following statement
rs.Open strsql, CurrentProject.Connection, adOpenForwardOnly, adLockReadOnly
The recordset returns 0 Records.
If I put in a breakpoint at the rs.open statement and then go into the immediate window and put in ?strsql I get the SQL Statement that is executed. I then copy that statement into Query analyzer and run it. I get the 1 record I expect to get there.
Why would I get different results between running a query in the Analyzer and running the exact same query in Code?