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

Query criteria from a form?

Status
Not open for further replies.

watrout

Technical User
Jul 7, 2003
17
US
I'm trying to develop a query that includes all records within a date range that the user specifies. I've done this before by entering a [Start Date] and [End Date] query ask parameter but I'm trying to make it more user friendly so I'm trying to grab a start & end date from a calendar form I have. I put the following formula in the query's criteria field: >=[Forms]![frmDate]![StartDate] And <=[Forms]![frmDate]![EndDate] -- Keep in mind, my &quot;frmDate&quot; form has a start date field & an end date field. Next to each field is a calendar button that opens the calendar form in pop-up mode.

Unfotunately this is not working. When I run the query I get an enter parameter value dialog box instead of my frmDate form starting up. How do I get my frmDate form to automatically start up when I run this query?!
 
Surely you would run the form and the form would run the query?

 
change your criteria in the query to read

between Forms![frmDate]![StartDate] And Forms![frmDate]![EndDate]

and as Mike stated you need to have the form open before you run the query not the other way around
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top