Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

referencing a subform for filtered query

Status
Not open for further replies.

tbac

Technical User
Jun 16, 2003
59
US
I want to be able to double-click on a field in a subform to open a popup form who's query is based on that subform. But I dont know the proper syntax for the query's criteria. If I wanted to reference the Main form I would use this for the criteria:

>[Forms]![EVALCURRENTSINGLE]![Ripe]-7 And <[Forms]![EVALCURRENTSINGLE]![Ripe]+5

(The Suform name is EVALFORPEDFORM)

Can I reference the subform within a main form?
 
It would be best to use alter the pop-up form to remove the parameters that reference the subform, then you can use the Where argument of OpenForm:

[tt]DoCmd.OpenForm "frmPopUp",,,"NameOfPopUpField > " & Me.[Ripe]-7 & " And NameOfPopUpField < " Me.[Ripe]+5[/tt]
 
Thanks, but I am curious mainly to know the proper syntax in a filtered query for referencing a subform within a main form.
 
Refer to the main form, the subform control, the form property, and the control:

[tt]=Forms!frmForm!SubformControlName.Form!txtTextbox[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top