Problems setting recordsource property in subform

J

jay

Setup: mdb application as a front-end to a SQL server database. There's a
main "Session" form and a "Services" subform (many services to one session
relationship). For some services, there is additional information required
that varies depending on the type of services offered. An "Extension" subform
control in the Services subform accommodates these Extension forms as needed.
If an Extension subform is needed, I change the SourceObject property of the
Extension subform control to the name of the Extension form that needs to be
loaded. (There is only one Extension record allowed for a given Service
record.) This loads the Extension form. The RecordSource property of each
Extension form is set at design-time to:
"SELECT field1, field2, ... FROM dbo_tblExtension001 WHERE
ExtensionForeignKey =
[Forms]![frmSession]![ctlSubService].[Form]![ServicePrimaryKey]".
I leave the LinkChildFields and LinkMasterFields in the "Extension"
subform control blank.
Problem: The above works like a champ in Access 2003 but I cannot make it
work in Access 2007 either by running it in Access 2002-2003 format or by
converting it to Access 2007 format. Access erases the Extension forms'
RecordSource fields! I tried resetting the RecordSource property at runtime,
as in: Me.RecordSource = strCorrectRecordSource but it doesn't "take." That
is, if I print Me.RecordSource in the immediate window right after I have
updated it, it prints as blank!
Has anybody run into anything this weird in Access 2007? Any help will be
really appreciated. Thanks in advance.
Jay
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top