Referencing a Control 2 Levels Deep in Navigation Forms (1 Viewer)

rodski

New member
Local time
Today, 15:49
Joined
Feb 4, 2013
Messages
15
I am struggling to refer to a control that is buried within 2 navigation forms. I have searched everywhere and tried different solutions but to no avail. This is the structure:

Top Form = "Main"
Navigation Subform = "NavSubForm"
2nd Navigation Subform = "TabSubForm"
Form holding the control = "frmSubForm"
Control on frmSubForm = "cboAssets"

The recordsource of "frmSubForm" is a query that looks at "cboAssets" in it's header; if it is null, then it pulls up all the records. If there is a choice in "cboAssets" it filters the records. I can get this to work fine when there is only 1 navigation form:

[Forms]![Main]![NavSubForm].Form![cboAssets]

However, I have been unable to get to this control when there is the additional subform ("TabSubForm") involved. I've tried:

[Forms]![Main]![NavSubform]![TabSubForm].Form![cboAssets]

and various combinations but to no avail. I think I understand the syntax, but I must be missing something obvious. If someone could please help, I would be forever grateful, but I need 2 things:

(1) How to reference this control &
(2) How to requery the "frmSubform"

Thanks a million in advance,
Rod
 

Dreamweaver

Well-known member
Local time
Today, 23:49
Joined
Nov 28, 2005
Messages
2,466
[Forms]![Main]![NavSubform]![TabSubForm]![frmSubForm].Form![cboAssets]


Not sure if it will work as I have only ever gone down 3 lvls but should work
 

rodski

New member
Local time
Today, 15:49
Joined
Feb 4, 2013
Messages
15
Hi MickJav,

Thanks for your quick response. Unfortunately, it didn't find it. I am wondering if it's because I'm placing it in a Query for the form's recordsource ("frmSubForm")? I have the "cboAsset" in the header of this form where the detail is a continuous form. Also, I'm only 2 levels down. When I try different variations with the Expression Builder in this query, I can get to the form but not the control.

Do you know the correct syntax to requery a form on a 2nd level navigation form and to use a combobox in the header of that form to filter the data in that form? I can get it to work perfectly in a 1 level navigation form but not when I add the 2nd level. The reason for doing this is to have left side navigation buttons on the main form & then horizontal buttons (for different buildings in my case) across the top.

Thanks if anyone can help!
 

rodski

New member
Local time
Today, 15:49
Joined
Feb 4, 2013
Messages
15
I finally figured it out. I believe part of the problem was because I embedded the query into the form where I had the control. When I removed this and made the record source a normal query, it worked. Here is how the query found the control:

[Forms]![Main]![NavSubForm].[Form]![frmSubForm].[form]![cboAssets]

The [TabSubForm] was part of the [NavSubForm] and not the control, hence it didn't need to be references. I hope others will find this helpful.
 

Users who are viewing this thread

Top Bottom