473,396 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

RecordSource Fails to Return rows..

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
1 1627
PEB
1,418 Expert 1GB
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

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

Similar topics

1
by: Lauren Quantrell | last post by:
I have a stored procedure named mySP that looks basically like this: Select Field1, Field2 From tblMyTable Where Field 3 = 'xyz' What I do is to populate an Access form: DoCmd.Openform...
4
by: rawheiser | last post by:
Behavior I found: Invalid Column name in select embedded in a IN() clause appears to return a NULL, and fails silently - completing the query giving incorrect results. Behavior I expected: ...
1
by: Steve Miles | last post by:
I've got a form with a combo box and begin/end dates. When any of the three are changed I set a subform's recordsource so the records returned are filtered based on the three fields. The syntax...
12
by: Joe Stanton | last post by:
Hello Group I have a query that works in Oracle and SQL Server, but fails in Microsoft Access. The query is: SELECT data fromTABLE1 WHERE data>='A&' AND data<'A''' Here is my sample data:
32
by: deko | last post by:
I have a popup form with a textbox that is bound to a memo field. I've been warned about memo fields so I'm wondering if I should use this code. Is there any risk with changing the form's...
3
by: stuart.medlin | last post by:
I have an Access 97 application that has a basic form (Transcript) and subform. The subform has a query as a recordsource that returns records from a table: SELECT DISTINCTROW Transcript.NCID,...
2
by: Tom_F | last post by:
To comp.databases.ms-access: In the VBA code behind a form, I would like to create a string variable, composed of the names of the field(s) in the primary key of the table which is the...
6
by: rcoco | last post by:
Hi, I have a datagrid that is ment to insert data. But when I run the form only the header appears. I would like some advise from you all and solve this problem I'm using visual studio 2003. My...
2
by: cek172 | last post by:
Is there any way to change the recordsource of a subform from the mainform? I have a subform that I would like to have return data from a table based on selections from multiple checkboxes on the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.