Referencing multi-level nested forms

V

Vasko

Hi,

I am still fighting with a problem I have with Access
2003 ADP connected to SQL Server 2000. I have three
levels of nested forms:

Level 1: Master form called DailyReport

Level 2: Subform control within DailyReport called
c_DailyReportAdditionalInfo with source object set to
DailyAdditionalInfo

Level 3: Subform control within DailyAdditionalInfo
called c_DailyAdditionalInfoSubdatasheet

I am trying to reference the Form property of a subform
within a subform and it breaks with an error
message: "Error 2455: You entered an expression that has
an invalid reference to the property Form/Report.". Of
course I couldn't find any help neither in the MSACC help
system nor in the MS Knowledgebase. The reference I use
at Level 2 is:
Me![c_DailyAdditionalInfoSubdatasheet].Form.RecordSource
= "" (i.e. I am trying to reference the Form property of
the subform control on Level 3)

The trick is that c_DailyAdditionalInfoSubdatasheet is a
Subform Control within a subform and I am trying to
reference it from the subform itself. I don't have a
problem using the same type of reference from the master
form level to the subform (Level 1 to Level 2). The
following reference executed from the Master Form level
works fine: Me![c_DailyAdditionalInfo].Form.RecordSource
= ""

It appears then the referencing mechanism works between
Level 1 and Level 2, but not between Level 1 & 3 or Level
2 & 3. The reverse reference works fine as well: On the
third level I could reference a control on the Master
Form by using Me.Parent.Form.Parent.Form![ID] for example.

Anybody any idea?

Cheers,
Vasko
 
V

Vasko

Thanks! Very useful resource, however the problem was not
syntax-related. It's just that MS Access intializes the
form instance of a subdatasheed form the first time you
expand the subdatasheet and *click* inside. Changing the
RecordSource on OnEnter event of Sub2Control solved the
issue... ;-))

-----Original Message-----
Take a look at
http://www.mvps.org/access/forms/frm0031.htm at "The
Access
Web"

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Vasko said:
Hi,

I am still fighting with a problem I have with Access
2003 ADP connected to SQL Server 2000. I have three
levels of nested forms:

Level 1: Master form called DailyReport

Level 2: Subform control within DailyReport called
c_DailyReportAdditionalInfo with source object set to
DailyAdditionalInfo

Level 3: Subform control within DailyAdditionalInfo
called c_DailyAdditionalInfoSubdatasheet

I am trying to reference the Form property of a subform
within a subform and it breaks with an error
message: "Error 2455: You entered an expression that has
an invalid reference to the property Form/Report.". Of
course I couldn't find any help neither in the MSACC help
system nor in the MS Knowledgebase. The reference I use
at Level 2 is:
Me! [c_DailyAdditionalInfoSubdatasheet].Form.RecordSource
= "" (i.e. I am trying to reference the Form property of
the subform control on Level 3)

The trick is that c_DailyAdditionalInfoSubdatasheet is a
Subform Control within a subform and I am trying to
reference it from the subform itself. I don't have a
problem using the same type of reference from the master
form level to the subform (Level 1 to Level 2). The
following reference executed from the Master Form level
works fine: Me! [c_DailyAdditionalInfo].Form.RecordSource
= ""

It appears then the referencing mechanism works between
Level 1 and Level 2, but not between Level 1 & 3 or Level
2 & 3. The reverse reference works fine as well: On the
third level I could reference a control on the Master
Form by using Me.Parent.Form.Parent.Form![ID] for example.

Anybody any idea?

Cheers,
Vasko


.
 

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