Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / July 2006

Tip: Looking for answers? Try searching our database.

DEFAULT Value in a Query PROMPT (Criteria-type) ??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kev100 - 06 Jul 2006 16:34 GMT
I've got a query which uses [Enter Date:] in the criteria to prompt the user
for the date.

The date they enter will Usually be the Current date...but not always.

Is there anything that can be added to the prompt that will automatically
insert/enter the current date....displaying it with the prompt...but allowing
the user to enter a different date, when needed?

Something like:

Enter Date: 07/06/2006

- or maybe  -

Enter Date (press Enter for today):

Thanks very much.
Allen Browne - 06 Jul 2006 16:45 GMT
Haven't actually tried this, but in the Criteria of your query, try
replacing:
   [Enter Date]
with:
   Nz([Enter Date], Date())

Be sure to declare the parameter so Access understands it correctly.
In query design view, choose Parameters on the Query menu.
In the dialog, enter:
   [Enter Date]            Date

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> I've got a query which uses [Enter Date:] in the criteria to prompt the
> user
[quoted text clipped - 16 lines]
>
> Thanks very much.
Duane Hookom - 06 Jul 2006 16:52 GMT
I much prefer and recommend using a control on a form for this since you can
set defaults etc. However, try
   Nz( [Enter Date (press Enter for today)], Date())

Signature

Duane Hookom
MS Access MVP

> I've got a query which uses [Enter Date:] in the criteria to prompt the
> user
[quoted text clipped - 16 lines]
>
> Thanks very much.
kev100 - 06 Jul 2006 23:49 GMT
>    Nz( [Enter Date (press Enter for today)], Date())

Thanks very much...that seems to work great.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.