tags:

views:

30

answers:

1

Hi, this has me pretty confused and I can't find the answer anywhere else so thought I'd post here to see if anyone can help!

I have a form in an Access 2007 database with a subform (sfSubform) embedded in it. The subform control's SourceObject is set to be another form (fForm). fForm's RecordSource starts out as a table.

At one point I want to change the data displayed in the subform to the result of a SQL statement, so I use

 sfSubform.Form.RecordSource = strSQL.  

This works fine. However, if I ouput the name of the RecordSource for fForm after making this change, it still gives the name of the table that I orginially set.

Does sfSubform.Form.RecordSource not change the source of fForm? Is it a copy of fForm that is embedded in the control?

Hope all that makes sense.

A: 

The sub-form and the form each have their own record source (or are unbound). That's the whole point, actually -- the ability to present two different data sets. Typically the two forms have related record sources and this relationship is declared using Master/Child Link, but that also is optional according to the need.

So no, changing one won't cause the other to be changed.

Smandoli