default value in parameter query

A

alecgreen

Hi

I have a parameter query that requests a 'run to date' in my query. Is
it possible to put a default value here which would meet most
requirements, but enable the user to enter a different date.

Many Thanks

Alec
 
B

Bob Barrows

alecgreen said:
Hi

I have a parameter query that requests a 'run to date' in my query. Is
it possible to put a default value here which would meet most
requirements, but enable the user to enter a different date.

Many Thanks

Alec

Try this:

where datefield >=
[Enter Run To Date in yyyy-mm-dd format (leave blank to accept default of
2011-04-20)]
or
([Enter Date in yyyy-mm-dd format (leave blank to accept default of
2011-04-20)]
is null and datefield <= #2011-01-20#)
You will likely have to declare this parameter as a date/time datatype.

Better yet, use a form to prompt for the date value. You can display the
default value in the textbox. Or, if using a calendar control, have the date
already selected when the form loads, allowing the user to change it as
required.
 
N

Nas Hashmi

Hi

I have a parameter query that requests a 'run to date' in my query. Is
it possible to put a default value here which would meet most
requirements, but enable the user to enter a different date.

Many Thanks

Alec

You can also use InputBox Function to set a default value.
 

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