Newbie question

J

John

Can I create a query dialogue form which ,for exaple, asks for two dates and
returnes a predetermined set of data based on the two values entered.
Example Query......show me sales which occured between (date 1) AND (date
2). John
 
F

fredg

Can I create a query dialogue form which ,for exaple, asks for two dates and
returnes a predetermined set of data based on the two values entered.
Example Query......show me sales which occured between (date 1) AND (date
2). John

Is the query the end result, or is the query used as recordsource for
a report?
 
J

John Vinson

Can I create a query dialogue form which ,for exaple, asks for two dates and
returnes a predetermined set of data based on the two values entered.
Example Query......show me sales which occured between (date 1) AND (date
2). John

Yes; if your form is named frmCrit, with textboxes named txtFrom and
txtTo, you can use a query with a criterion on SalesDate such as
= [Forms]![frmCrit]![txtFrom] AND < DateAdd("d", 1, [Forms]![frmCrit]![txtTo])

The dateadd bit protects you from SalesDate records which contain a
time portion: #11/14/2005 20:45:30# is in fact later than November 14
(which assumes midnight at the start of the day).

John W. Vinson[MVP]
 
Top