DEFAULT Value in a Query PROMPT (Criteria-type) ??

  • Thread starter kev100 via AccessMonster.com
  • Start date
K

kev100 via AccessMonster.com

I've got a query which uses [Enter Date:] in the criteria to prompt the user
for the date.

The date they enter will Usually be the Current date...but not always.

Is there anything that can be added to the prompt that will automatically
insert/enter the current date....displaying it with the prompt...but allowing
the user to enter a different date, when needed?


Something like:

Enter Date: 07/06/2006

- or maybe -

Enter Date (press Enter for today):

Thanks very much.
 
A

Allen Browne

Haven't actually tried this, but in the Criteria of your query, try
replacing:
[Enter Date]
with:
Nz([Enter Date], Date())

Be sure to declare the parameter so Access understands it correctly.
In query design view, choose Parameters on the Query menu.
In the dialog, enter:
[Enter Date] Date
 
D

Duane Hookom

I much prefer and recommend using a control on a form for this since you can
set defaults etc. However, try
Nz( [Enter Date (press Enter for today)], Date())
 
K

kev100 via AccessMonster.com

Nz( [Enter Date (press Enter for today)], Date())

Thanks very much...that seems to work great.
 

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

Top