Adressing subform in Query

M

Microsoft

Hallo,

I have main form with subform. The subform has another subform.

How can i address a field on the subforms subform in a query?

The below doesn't work but i think it should be something like this:

Query criteria:
[Forms]![frmMain].[frmSub1].[frmSub2].[Form]![FieldOnfrmSub2]

What is the correct line?

Regards,

Harmannus
 
V

Van T. Dinh

Try:

[Forms]![frmMain]![frmSub1].[Form]![frmSub2].[Form]![FieldOnfrmSub2]

provided that [frmSub1] and [frmSub2] are the names of the *SubformControls*
which can be different from the names of the Forms you used as the Subforms
(or more accurately, the SourceObjects of the SubformControls).

You can only check the name of the SubformControl in the DesignView of the
Parent Form.
 
H

Harmannus

Hallo,

Thanx the help! This works.

Harmannus


Van T. Dinh said:
Try:

[Forms]![frmMain]![frmSub1].[Form]![frmSub2].[Form]![FieldOnfrmSub2]

provided that [frmSub1] and [frmSub2] are the names of the *SubformControls*
which can be different from the names of the Forms you used as the Subforms
(or more accurately, the SourceObjects of the SubformControls).

You can only check the name of the SubformControl in the DesignView of the
Parent Form.

--
HTH
Van T. Dinh
MVP (Access)



Microsoft said:
Hallo,

I have main form with subform. The subform has another subform.

How can i address a field on the subforms subform in a query?

The below doesn't work but i think it should be something like this:

Query criteria:
[Forms]![frmMain].[frmSub1].[frmSub2].[Form]![FieldOnfrmSub2]

What is the correct line?

Regards,

Harmannus
 

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