PC Review


Reply
Thread Tools Rate Thread

default value in parameter query

 
 
alecgreen
Guest
Posts: n/a
 
      20th Apr 2011
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
 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      20th Apr 2011
alecgreen wrote:
> 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.


 
Reply With Quote
 
Nas Hashmi
Guest
Posts: n/a
 
      1 Week Ago
On Wednesday, April 20, 2011 2:30:53 AM UTC-4, alecgreen wrote:
> 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.


On Wednesday, April 20, 2011 2:30:53 AM UTC-4, alecgreen wrote:
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parameter Query Default Value Goofy Microsoft Access 5 24th Apr 2012 05:35 AM
How to set Default value for Parameter in a query using a paramete =?Utf-8?B?SmF3YWhhcg==?= Microsoft Access VBA Modules 1 1st Nov 2005 09:56 PM
How to put a default value into a parameter query? Bucky Microsoft Access 2 28th Mar 2005 01:19 AM
Re: Default Value in Parameter Query? Duane Hookom Microsoft Access Queries 4 22nd Sep 2004 04:35 PM
Default Value in Parameter Query? =?Utf-8?B?Um9ieW4gSC4=?= Microsoft Access Queries 0 20th Sep 2004 09:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:47 AM.