Marchese Il Chihuahua
Marchese Il Chihuahua

Reputation: 1139

Creating a query which references a sub form from a sub form

I am trying to reference a control 'txtDescription' located on sub form 'frmStaticDataSkills02' from the sub form 'frmStaticDataSkills03'. Both of these forms sit in form 'frmStaticDataSkills01' which is a sub form of form 'frm_StaticData'. Below is my string that is not working.

=[Forms]![frmStaticDataSkills01]![frmStaticDataSkills02].[Form]![txtDescription]

Upvotes: 0

Views: 96

Answers (2)

Marchese Il Chihuahua
Marchese Il Chihuahua

Reputation: 1139

My problem was a simple referencing issue where I wasn't successfully retrieving a control's contents which was located on a sub form nested three sub forms deep. The answer I posted solved my issue. PS- 'Maschere' means 'forms' in Italian (i am using the Italian version of Access. (I edited the answer to avoid confusion.

=[Maschere]![frm_staticdata]![frmStaticDataSkills01].[Form]![frmStaticDataSkills02].[Form]![txtDescription]

Upvotes: 1

ikervb
ikervb

Reputation: 11

First go to the parent form of the form You are in and then go to the subform you want

Suppose you have a form with two subforms and you are in subform1 and want to access a textbox on subform2. Try the following:

Me.parent.subform2.form.textbox

You have to use the word "form" to specify the form object contained in frame subform2

Upvotes: 1

Related Questions