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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

subform asking for parameters 1

Status
Not open for further replies.
Jun 4, 2003
58
US
I have a query with a date criteria...
Between [Forms]![frm_1]![TextDate1]! And [Forms]![frm_1]![TextDate2]!

The user enters the dates in frm_1 and hits a command to run a report based off of the query above, and it works fine.

However, if I make frm_1 a subform in frm_2, and hit the command button, it asks for the parameter values of TextDate1 and TextDate2.

I don't know what I am overlooking. Any help or suggestions would be great.

Thanks!
 
A subform isn't reqognized as an open form, but a control on the main form on which it resides. Some different syntax, perhaps something like this:

[tt]Between [Forms]![frm_2]![frm_1].Form![TextDate1] And [Forms]![frm_2]![frm_1].Form![TextDate2][/tt]

Roy-Vidar
 
Roy-Vidar
Thanks for the advice, but it didn't work

It still asked for the parameter values
 
Easiest way of obtaining the correct references is by using the expression builder (while the form is open). For instance from the qriteria row of the query, right click, select build, then doubleclick thru forms, loaded forms, main form, subform and the control in question.

The subform control name, which is used in the expression, might differ from the subform name as viewed in the database window.

Here's a Microsoft article on How to Refer to a Control on a Subform or Subreport

Roy-Vidar
 
RoyVidar,
excellent...actually your first thought was slightly off
The formula for the query criteria needed to be...

Between [Forms]![frm_2]![SUBFORMNAME]![TextDate1] And [Forms]![frm_2]![SUBFORMNAME]![TextDate2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top