none
How do access a two tier nested NavigationSubform in MS Access 2016? RRS feed

  • Question

  • Hello,

    I've been trying to access a field in a multi level nested Navigationsubform in a query.  Can this be done?

    This is what I've tried so far:

    [Forms]![Main]![NavigationSubform].[Form]![Cashier_frm]![NavigationSubform].[Form]![Pickup_frm]![Form]![New_frm].[ID]

    Main Form:  [Main]

    Tab Name:   [NavigationButton46] "Cashier"

    NavigationSubForm: [Cashier_frm]

    Tab Name: [tabPickup] "Pick-up"

    NavigationSubForm: [Pickup_frm]

    Tab Name: [tabNewPickup] "New"

    Form: New_frm

    Field : ID



    Thursday, June 13, 2019 6:13 PM

Answers

  • Keep in mind that the subform control which you place on a form is a container for a form, and is not the same thing as the form that it contains.  Here we are concerned with the names of the subform *controls*, not the names of the actual forms they contain, when we are navigating through layers of subforms.  This can get confusing though, because they can be named the same.  I make it a habit, every time I create a subform, to name it "sf_" plus whatever the underlying form's name is, so if I have a form called Cashier_frm and I make that form a subform on another form, I name the subform *control* name sf_Cashier_frm.

    In your case, if you have a form with two levels of subform and the top level form is called Main and the subform control on Main is called Cashier_frm, and the subform control on Cashier_frm's underlying form is called Pickup_frm then

    Forms!Main!Cashier_frm.Form!Pickup_frm.Form!ID

    should do the trick.

    -Bruce

    • Marked as answer by ShirleyCurly Tuesday, June 18, 2019 3:23 PM
    Thursday, June 13, 2019 9:46 PM

All replies

  • Keep in mind that the subform control which you place on a form is a container for a form, and is not the same thing as the form that it contains.  Here we are concerned with the names of the subform *controls*, not the names of the actual forms they contain, when we are navigating through layers of subforms.  This can get confusing though, because they can be named the same.  I make it a habit, every time I create a subform, to name it "sf_" plus whatever the underlying form's name is, so if I have a form called Cashier_frm and I make that form a subform on another form, I name the subform *control* name sf_Cashier_frm.

    In your case, if you have a form with two levels of subform and the top level form is called Main and the subform control on Main is called Cashier_frm, and the subform control on Cashier_frm's underlying form is called Pickup_frm then

    Forms!Main!Cashier_frm.Form!Pickup_frm.Form!ID

    should do the trick.

    -Bruce

    • Marked as answer by ShirleyCurly Tuesday, June 18, 2019 3:23 PM
    Thursday, June 13, 2019 9:46 PM
  • Thank You Bruce for the advice and help.   You're wonderful!
    Tuesday, June 18, 2019 3:24 PM