auto prompt

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
change your criteria to...

Between [EnterStartDate] and [EnterStopDate]


(or something similar)
 
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.
 
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
 

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

Similar Threads

Date Range Query 6
Query 1
like[]* 2
Work Days 5
Qry help...Maybe a double post...my apologies in advance... 7
formula 28
Calculated dates 7
Access 2003 1

Back
Top