auto prompt

H

Humbertt

I'm new to access however i managed to create a mdb with two tables and a
query to run a report. My question is when i have to run my query i have to
manual change the critiera in the date field to <= ##/##/#### to >=
##/##/####. How can i have access just ask me the dates i want to enter
instead of going into the critiera. Any ideas or tips in which I can create
this. Thanks inadvance.
 
R

Rick B

change your criteria to...

Between [EnterStartDate] and [EnterStopDate]


(or something similar)
 
D

Douglas J. Steele

Actually, if the intent is to sometimes just provide a start date with no
stop date, other times to provide just a stop date with no start date, other
times to provide both, and sometimes to provide neither, the WHERE clause
should be something like:

WHERE (MyDateField >= [EnterStartDate] OR [EnterStartDate] IS NULL)
AND (MyDateField <= [EnterStopDate] OR [EnterStopDate] IS NULL)


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Rick B said:
change your criteria to...

Between [EnterStartDate] and [EnterStopDate]


(or something similar)



--
Rick B



Humbertt said:
I'm new to access however i managed to create a mdb with two tables and a
query to run a report. My question is when i have to run my query i have
to
manual change the critiera in the date field to <= ##/##/#### to >=
##/##/####. How can i have access just ask me the dates i want to enter
instead of going into the critiera. Any ideas or tips in which I can
create
this. Thanks inadvance.
 
L

Larry Daugherty

The direct answer to your question is: Put the following line of code
into the criteria line of the date field in the report's query:

Like Between [Enter start date] and [Enter end date]


My preference is to not interrupt the flow of things by asking for
individual parameters. I usually create an intermediate form that I
call a "Launcher" to accumulate report parameters and then call the
reports from command buttons on that form. Require the user to fill
the required parameters before actually executing the report. In that
case change the above line to;

Like between forms!frmLauncher!txtStart AND
forms!frmLauncher!txtEnd

HTH
 
Top