Refer to Combobox on a subform within Navigation Form in a query parameters (1 Viewer)

tanalea

New member
Local time
Today, 13:15
Joined
Jun 6, 2013
Messages
3
Hi all,

There is a command button on my form that calls a filtered query. I'm filtering the query based on a combo box within the form using
[Forms]![frmAssignDwgs]![Combo15]


It works beautifully until I put the form as a subform in the Navigation Form I'm using. When I execute it from within the Navigation form, it errors out looking for [Forms]![frmAssignDwgs]![Combo15].

Is there another syntax I can use so this will still work from within the Navigation Form? Or another way to approach this functionality?

frmNavigation is the main navigation form
frmAssignDwgToPkgs is the subform that holds Combo15

I found another thread (which I can't link to since I'm new) and tried various arrangements of the following to no avail.

[Forms]![frmNavigation]![NavigationSubform] .[Forms]![frmAssignDwgToPkgs]![Combo15]

Much thanks for any assistance!

Thanks!
Tana


 

Mr. B

"Doctor Access"
Local time
Today, 15:15
Joined
May 20, 2009
Messages
1,932
The easiest way to get the statement correct is to have your navigation form with the sub form in in open in design view. Open your query. In the criteria where you have your reference now, right click and select the "Build" option.

Use the options to locate the open form and the sub form listed below it. When you select the subform below the navigation form in the next list to the right you will see all of the controls locate the combo box you need to refer to and double click it. Access will write the statement you need to use to refer to that control.

Exit the Builder and save your query.
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 07:15
Joined
Jan 20, 2009
Messages
12,849
The second "Forms" should be "Form"
Forms is the Application's Forms Collection
Form is the Form property of the subformcontrol [NavigationsSubform]

The Form Property returns the instance of the Form Object designated by the SourceObject Property of the subformcontrol.

Code:
[Forms]![frmNavigation]![NavigationSubform].Form![Combo15]
 

tanalea

New member
Local time
Today, 13:15
Joined
Jun 6, 2013
Messages
3
Galaxiom - that worked perfectly!!! Thank you. I've been trying to get the right combination for days.

Mr. B - that's what I had originally tried after seeing that suggestion on another thread, resulting in the path I shared which still didn't work for me. Maybe I wasn't using the builder correctly. Thanks for the response though.


 

Snowflake68

Registered User.
Local time
Today, 20:15
Joined
May 28, 2014
Messages
452
The second "Forms" should be "Form"
Forms is the Application's Forms Collection
Form is the Form property of the subformcontrol [NavigationsSubform]

The Form Property returns the instance of the Form Object designated by the SourceObject Property of the subformcontrol.

Code:
[Forms]![frmNavigation]![NavigationSubform].Form![Combo15]

Thank you so much for this post. Ive been trying to get this right for hours but finally sorted thanks to your help. :D
 

Users who are viewing this thread

Top Bottom