Navigation form Criteria help

oxicottin

Learning by pecking away....
Local time
Yesterday, 19:25
Joined
Jun 26, 2007
Messages
870
Hello, I have a navigation form (first time trying this) that one of my tabs has a form with a subform. When I open the navigation form and select that tab with the form/subform I get a popup that is asking for a criterion that the subform uses and is linked to its form if that makes sense.

Now if I don't open the "Navigation form" and just open the form/subform by itself then the criteria the sub uses works fine. I have tried several syntaxes in the criteria for the subform but it always goes back to incorrect formula syntax. What am I doing wrong?

Navigation form is frm_Main
Form that has the subform is frm_ProductHoldData
and its subform name is sfrm_ProductHoldData

I have tried:
  • [Forms]![frm_ProductHoldData]![txtHoldID]
  • Forms!frm_Main!frm_ProductHoldData.Form!txtHoldID

Suggestions?
 
By "navigation form" do you mean the Navigation Form object or just a normal form/subform arrangement?

In either case, must reference subform container control name, not form name. I always name container different from form it holds, like ctrProduct. So refence is:

Forms!frm_Main.ctrProduct.Form.txtHoldID

If this is the Navigation Form object, then Access installs a subform container with a default name of NavigationSubform.

Forms!frm_Main.NavigationSubform.Form.txtHoldID

Exactly where are you using this reference?
 
if you are using Navigation Form, try this:

DoCmd.BrowseTo acBrowseToForm, "frm_ProductHoldData", "frm_main.NavigationSubForm"
 
I have a navigation form
OK, assuming actual navigation form called frm_Main

When I open the navigation form and select that tab
OK, clicking the button opens frm_ProductHoldData in the navigation subform control.

Now if I don't open the "Navigation form" and just open the form/subform by itself then the criteria the sub uses works fine
If this is the criteria:
  • [Forms]![frm_ProductHoldData]![txtHoldID]
  • Forms!frm_Main!frm_ProductHoldData.Form!txtHoldID
It works without the navigation form because frm_ProductHoldData does not have a parent. Since the navigation form makes frm_ProductHoldData its child, you have to account for that.
 
Attached is a cut down version of the DB so names etc isn't included. The quesry in question that uses a record source criterion is sfrm_ProductHoldData/Data/Record Source. It's the field HoldID Criteria [Forms]![frm_ProductHoldData]![txtHoldID].

If I open the frm_Main and select the tab "PRODUCT HOLD DATA" it displays the frm_ProductHoldData and sub sfrm_ProductHoldData were I get the error. I'm sorry I'm new to using Create/Navigation/......

Thanks,
 
Do you plan to have more tabs/forms placed on this Navigation Form?

Really should not have this criteria in RecordSource. This subform container has Master/Child links set and that should dictate which related records will display. And then the textbox is extraneous.

Advise not to have exact same field name in multiple tables.
 
Last edited:
If you just remove the criteria from the query, does the app work the way you intend?
 
yes remove your Criteria on the recordsource of the subform.
also set the Link Master Fields of the subform to:

txtHoldID
 

Attachments

If you just remove the criteria from the query, does the app work the way you intend?

They are linked by HoldID, didn't realize I did that previously, I didn't need the criteria because of that. Yes it worked......

Sorry fellas!
 

Users who are viewing this thread

Back
Top Bottom