Using Table data in Criteria of Query

Maleko

New member
Local time
Today, 00:34
Joined
Nov 5, 2007
Messages
2
Hi

I am trying to set up a number of queries to return completed jobs with a specified time frame, usually monthly. So rather than have to type the same dates in arround 20 times I tried to use the data from a table in the Criteria. This did not work any suggestion would be much appreciated.

Attached is a screen shot showing a fragment of the query and the dilog box I get when it runs.

Thanks Marcus
 

Attachments

  • AccessqryScreenshot.jpg
    AccessqryScreenshot.jpg
    33.1 KB · Views: 283
Use a form to enter the dates on and reference the form in each of the queries.

Add 2 text boxes to a form and in your queries set the criteria (substituting with actual form name and text box names) to:

Between [Forms]![Nameoftheformyoucreated]![Nameoftextboxfromdate] And [Forms]![Nameoftheformyoucreated]![Nameoftextboxtodate]

The form will need to remain open when the queries run, you can run the queris from a command button on the form.
 
Thanks Michael,

Your solution worked a treat.

Regards Marcus
 

Users who are viewing this thread

Back
Top Bottom