By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,312 Members | 1,330 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,312 IT Pros & Developers. It's quick & easy.

RecordSource Fails to Return rows..

P: 1
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..
Aug 2 '06 #1
Share this Question
Share on Google+
1 Reply


PEB
Expert 100+
P: 1,418
PEB
Check your main and Child Fields! on the subform properties!

It seems that your problem is there!

It shows information when the master field is equal of the chield field!

:)
Sep 3 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.