default value in parameter query

  • Thread starter Thread starter alecgreen
  • Start date Start date
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
 
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.
 
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.
 
Back
Top