Do sfSubForm.fForm.RecordSource and Forms(fForm).RecordSource refer to the same object and property?

Posted by Raymond Rosalind on Stack Overflow See other posts from Stack Overflow or by Raymond Rosalind
Published on 2010-05-13T21:27:25Z Indexed on 2010/05/13 21:34 UTC
Read the original article Hit count: 141

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about ms-access

Related posts about vba