Date parameters in a query

G

Guest

I've created a query, Production Time, with a parameter set to look up values
between two dates. The query is to show Time Available, Running Time and
Downtime. The value for Time Available is taken from a table, the Running
Time and Downtime are taken from a query. The Run Time and Downtime queries
contain the parameter to select dates. When I run the Production Time query
I have to enter the start date and end date twice, how do I change this so I
only have to enter the dates once?
 
G

Guest

Create a form not linked to any table (AKA unbound form) named frmSearch. On
this form put two text boxes named txtStartDate and txtEndDate. Also put a
button on the form that will run the query. The Command Button wizard will
guide you through it under Miscellaneous, Run Query.

In the query put the following in the appropriate criteria boxes:
[Forms]![frmSearch]![txtStartDate]
[Forms]![frmSearch]![txtEndDate]

You put the dates in the form and then run the query. The form needs to stay
open; however, it could be minimized or even hidden.
 
G

Guest

Thanks, got that working now

Jerry Whittle said:
Create a form not linked to any table (AKA unbound form) named frmSearch. On
this form put two text boxes named txtStartDate and txtEndDate. Also put a
button on the form that will run the query. The Command Button wizard will
guide you through it under Miscellaneous, Run Query.

In the query put the following in the appropriate criteria boxes:
[Forms]![frmSearch]![txtStartDate]
[Forms]![frmSearch]![txtEndDate]

You put the dates in the form and then run the query. The form needs to stay
open; however, it could be minimized or even hidden.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

Tommy2326 said:
I've created a query, Production Time, with a parameter set to look up values
between two dates. The query is to show Time Available, Running Time and
Downtime. The value for Time Available is taken from a table, the Running
Time and Downtime are taken from a query. The Run Time and Downtime queries
contain the parameter to select dates. When I run the Production Time query
I have to enter the start date and end date twice, how do I change this so I
only have to enter the dates once?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top