Google Answers Logo
View Question
Q: MS Access 2000 Query Default Values ( Answered 4 out of 5 stars,   0 Comments )
Subject: MS Access 2000 Query Default Values
Category: Computers > Software
Asked by: sjkistler-ga
List Price: $10.00
Posted: 12 Feb 2003 07:20 PST
Expires: 14 Mar 2003 07:20 PST
Question ID: 160425
Running MS Access 2000

In a query, I want to prompt the user for a specific date, have
entered the following in the criteria line: >[Earliest renewal date to
include?]. This works fine. However, I would like the default date to
be 30 days prior to the current date, but I can't figure out how to
enter a default date into the message box (and how to make that date
30 days prior to current date). How?

Request for Question Clarification by hammer-ga on 12 Feb 2003 08:55 PST
The best way to do this is to run your query using a small form with a
text box and a command button. Will you accept this method as an

- Hammer

Clarification of Question by sjkistler-ga on 12 Feb 2003 09:45 PST
I'm afraid not. I don't want to make forms for each query (I have LOTS
of these to do - lots of replication of the same basic problem). It is
elegant now to just work directly with the query if at all possible.
Subject: Re: MS Access 2000 Query Default Values
Answered By: hammer-ga on 12 Feb 2003 10:18 PST
Rated:4 out of 5 stars
The only way to do this without using a form is to use the following
as your criteria:

IIf(IsNull([Earliest renewal date to include?]),Date()-30,[Earliest
renewal date to include?])

This will offer the criteria popup. If the box is left blank, the
IsNull test comes True, and the criteria will use the default of
Date() - 30. Otherwsie, it will use the value entered. This will cause
the query to use today's date - 30 days, if the box is left blank.
There is no way to make the default date prefill in the parameter box.
You may be able to reword to indicate this, but space is limited. If
you change the prompt, make sure you change it in both arguments.

- Hammer

Search Strategy:
Google Groups
Access default criteria query

Clarification of Answer by hammer-ga on 12 Feb 2003 11:32 PST
By the way, I found reference to a tricky workaround that may allow
you to show a box with the default value filled in. I tried it, but
it's behaving oddly. I'm still investigating. If I get it working,
I'll post it as a clarification.

- Hammer

Clarification of Answer by hammer-ga on 13 Feb 2003 04:27 PST
Well, the workaround appears to be so tricky that it doesn't actually
work! It looks like my original answer stands.

- Hammer
sjkistler-ga rated this answer:4 out of 5 stars

There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  

Google Home - Answers FAQ - Terms of Service - Privacy Policy