PC Review


Reply
Thread Tools Rate Thread

Default Dates

 
 
Ampridge
Guest
Posts: n/a
 
      3rd Jun 2010
I have a query that calculates records between two dates as

Between [Beginning Date] And [Ending Date]

Is there a way to show a default value for the beginning and ending dates in
the input boxes rather than having to enter a date every time?

Thank you for any help

Paul.
 
Reply With Quote
 
 
 
 
KARL DEWEY
Guest
Posts: n/a
 
      3rd Jun 2010
Yes. Open the form in design view, click on the text box, right click,
scroll to bottom, click on Properties, enter a default value or formula and
select the format.
--
Build a little, test a little.


"Ampridge" wrote:

> I have a query that calculates records between two dates as
>
> Between [Beginning Date] And [Ending Date]
>
> Is there a way to show a default value for the beginning and ending dates in
> the input boxes rather than having to enter a date every time?
>
> Thank you for any help
>
> Paul.

 
Reply With Quote
 
John Spencer
Guest
Posts: n/a
 
      3rd Jun 2010
No, there is no way to have a default date DISPLAYED. You can however have a
default date For instance to default to a range of Jan 1 of the current year
to Dec 31 of the current year.


Between Nz([Beginning Date],DateSerial(Year(Date()),1,1))
And NZ([Ending Date],DateSerial(Year(Date()),12,31))

You could change the parameter prompt to something like:
[Beginning Date - Blank = Jan 1 Current Year]

If you want defaults, the best way is to use a FORM to get the dates. You can
set defaults for controls on a form.


Check out this article for a detailed discussion.
http://www.fontstuff.com/access/acctut08.htm

Or check out this from MS
http://office.microsoft.com/en-us/ac...730581033.aspx

Or for another example
http://allenbrowne.com/ser-62.html


A brief quote from a John Vinson (Access MVP) posting.

You'll need to create a small unbound Form (let's call it frmCriteria) with a
Combo Box control (cboCrit) on it. Use the combo box wizard to select the
table for the selections, and be sure that the bound field of the combo is the
value you want to use as a criterion. Save this form.

Now use

=[Forms]![frmCriteria]![cboCrit]

as the criterion in your Query.

It's convenient to base a second Form or Report on the resulting query to
display the results; if you put a button on frmCriteria to launch that form or
report, the user can enter the criterion and view the results in one simple
operation!

End quote

Keywords: Parameter Queries, comboboxes

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County

Ampridge wrote:
> I have a query that calculates records between two dates as
>
> Between [Beginning Date] And [Ending Date]
>
> Is there a way to show a default value for the beginning and ending dates in
> the input boxes rather than having to enter a date every time?
>
> Thank you for any help
>
> Paul.

 
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
Default Dates Secret Squirrel Microsoft Access 2 9th Dec 2008 03:24 AM
Default due dates? =?Utf-8?B?TG9yaQ==?= Microsoft Outlook BCM 0 29th Aug 2006 05:31 PM
Default Dates =?Utf-8?B?U3Vl?= Microsoft Excel Misc 1 22nd Jul 2005 12:29 PM
default value and dates =?Utf-8?B?Y2VhZHNlYXJj?= Microsoft Access Database Table Design 3 5th Jul 2005 04:09 PM
Default dates Steve S Microsoft ADO .NET 1 30th Sep 2003 01:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:57 AM.