View Full Version : User Selected Dates


sgarrett
03-11-2002, 07:05 AM
Hi,

I want to be albe to have the user enter dates to get a report. In otherwords. They should be able to enter the from date and the to date and then the report will only gather infromation between those dates. What is the best way of going about this?

TessB
03-11-2002, 07:15 AM
There are two ways to do this. Simplest is this.

In your query, find the date field that you are trying to filter. In the criteria section, enter this

>=[Enter beginning date] AND <= [Enter ending date]

This will prompt the user to enter the data every time the query is run.

Otherwise, a prettier option, in my humble opinion, is to create a form, perhaps you already have one, with the command button to run the query and put your two text fields on that form.


Please enter the beginning date:
fldBeginDate

Please enter the ending date:
fldEndDate

Then, in the query, reference the dates on the form in the field's criteria as such.

>=[frmStarterForm].fldBeginDate AND <= [frmStarterForm].fldEndDate

Clear?
Tess

sgarrett
03-11-2002, 08:46 AM
Thanks that's sort of what I thought (the form thing) I will give it a try and let you know