473,472 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Subform Form.RecordSource inconsistent?

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 I'm using
is:

Me.{subform-name}.Form.RecordSource = "Select * from tbl..."

....including the three fields in the SQL Where clause. This method
works well, but mysteriously stops returning any rows once in a while.
I can hard-code the SQL to return all rows and sometimes it works,
sometimes it doesn't. I don't think I've got any SQL syntax errors
since it works most of the time. I've closed out of Access and tried
both A2k and A2k3, both of which failed to return any rows, then just
as mysteriously began working properly.

Any clues what might be going on?
Nov 13 '05 #1
1 1995
When you change the form recordsource, you should also reset
the master/child fields to "". I think current versions of
Access will helpfully set these fields under some conditions.

Another thing that might be happening is Filtering. Subform
filters will helpfully snap in and out of play when you least
expect it. Don't try to filter subforms: make sure all the filters
are blank.

(david)
"Steve Miles" <el***@hotmail.com> wrote in message
news:b8**************************@posting.google.c om...
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 I'm using
is:

Me.{subform-name}.Form.RecordSource = "Select * from tbl..."

...including the three fields in the SQL Where clause. This method
works well, but mysteriously stops returning any rows once in a while.
I can hard-code the SQL to return all rows and sometimes it works,
sometimes it doesn't. I don't think I've got any SQL syntax errors
since it works most of the time. I've closed out of Access and tried
both A2k and A2k3, both of which failed to return any rows, then just
as mysteriously began working properly.

Any clues what might be going on?

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: CSDunn | last post by:
Hello, I have a combo box (Combo7) that needs to call a function during the After Update event of the combo box. The function resides in an Access 2000 ADP Module called MMAnswerData_code. The...
0
by: CSDunn | last post by:
Hello, In Access ADP's that connect to SQL Server databases, any time I have a situation where I have a combo box in a main form that looks up a record in a subform, the subform record source has...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
12
by: MLH | last post by:
I have created two forms: frmBrowseNegsMainform and frmBrowseNegsSubform. I put a subform control on the first of these. The SourceObject property for the subform control is, of course,...
4
by: Dave Boyd | last post by:
Hi, I have two very similar forms each with a subform. The main form gets a few fields from the user and passes this back to a query that the subform is bound to. The requery is done when the...
2
by: Bill Agee | last post by:
I have a subform called PaymentDetails and would like to dynamically assign the recordsource after the form/subform is opened. The recordsource for Payment Details is "PaymentDetails_qry" which...
9
by: PC Datasheet | last post by:
I'm stuck on something that seems should be easy and I need some help. My main form has an option group with five options. My subform chooses from different lists depending on which option is...
9
by: robert d via AccessMonster.com | last post by:
I'm not sure why the following isn't working. The subform loads correctly, but no data is displayed. I'm certain that there is data and I have checked that the SQL statement does in fact return...
1
by: veteranwebdesign | last post by:
Hello, I have a main form. I want forms to open in a subform control box. What is the code for the option group to open the subforms in the control box. I didn't create subforms, I created...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
1
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.