Hello..
I am attempting to load a Subform from a recordset. The recordsource is set to a string containing SQL using a query object. The Recordsource returns 0 rows in RecordSet, yet when the same SQL string is executed as in a query panel, the result set contains many rows.
I am new to using ACCESS. The Parent form contains listbox/textbox fields used to build the where condition of the SQL string. The SQL string is built based on a click event of a button on the parent form. In Debug mode, each field in the where clause contains the proper numeric/string matching the output fields from the query. Using Addwatch on the SQL string variable, I captured the SQL string which I ran without incident in the query panel.
I have tried changing the SQL to use any other table with just SELECT * FROM tblname, and get the same result.
When I used an SQL select using constants in the Select SQL, (SELECT 'string', 0 from tblname) immediately after the first fails, the RECORDSET contains a row.
I have checked via GOOGLE looking for other instances of this kind of problem, and did not find a comparable. We are using the same technique in other forms, and it works without incident.
Thanks for any help..