A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Default Dates



 
 
Thread Tools Display Modes
  #1  
Old June 3rd, 2010, 04:07 PM posted to microsoft.public.access.queries
Ampridge
external usenet poster
 
Posts: 2
Default Default Dates

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.
  #2  
Old June 3rd, 2010, 04:56 PM posted to microsoft.public.access.queries
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Default Dates

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.

  #3  
Old June 3rd, 2010, 06:49 PM posted to microsoft.public.access.queries
John Spencer
external usenet poster
 
Posts: 7,815
Default Default Dates

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.

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.