Subform "forgets" changes to record source

AccessNut

Registered User.
Local time
Yesterday, 18:23
Joined
Jun 23, 2007
Messages
16
Hi, all, I need help with solving this puzzle:

1. I created a subform with a query as the record source. Added the subform to a main form.

2. I added a new field to a table that the subform query uses. I then updated the subform query's select clause to add the new field.

3. I added a text box on the subform with its control source being the new field in the subform query.

4. Tested the subform, which performed as expected, the new field is showing up in the text box correctly.

5. Tested the main form, got this error: "No such field in the field list"
I went back to the subform to view the record source.
It appears that the query change was "forgotten" by the subform.

The subform is a continuous form.

I also tried creating a new main form and adding the subform to it. The subform remembers the change, but as it appears on the main form, the text box displays "#Name" instead of actual values.

Anyone knows what's going on? How do I get around this? Thanks so much.
 
AccessNut,

I'd guess that your main form is assigning the SQL for your query and
"over-writing" your new SQL.

Wayne
 
Thank you Wayne. I found a piece of code that contains the SQL in the subform in the On Load event. I incorporated the new field in the SQL and it is working.
 

Users who are viewing this thread

Back
Top Bottom