validation rule

A

AsquareDC

I would appreciate if someone can help me with the validation rule for medium
date on a table design property e.g. 30-Jun-2008.
 
K

KARL DEWEY

You are mixing terms. Medium Date is a display format, not a validation.

A validation would be something like --
#1/1/2000# - Any date after beinning of the millennium
<=Date() - Today or eariler
 
A

AsquareDC

thx for your response.

I do have my date field formatted as medium date. I would like to force data
entry on the medium date format as well otherwise the record should not be
accepted. I have been such errors as ####################### because data was
incorrectly entered. So to get over this, i reckon that have a validation
rule which would only accept entry into this date field according to the
medium date format.

Pls advise.
 
K

KARL DEWEY

If your field is datatype DateTime then Access will accept many different
formats for data entry but only display that which you set as format for your
query, for, or report.
 
J

John W. Vinson

thx for your response.

I do have my date field formatted as medium date. I would like to force data
entry on the medium date format as well otherwise the record should not be
accepted. I have been such errors as ####################### because data was
incorrectly entered. So to get over this, i reckon that have a validation
rule which would only accept entry into this date field according to the
medium date format.

The date is NOT stored in medium date format, or in any other format. A
Date/Time value is actually stored as a number, a count of days and fractions
of a day (times) since midnight, December 30, 1899. As such you can have a
date stored in a table and display it in one place as 6/30, in another textbox
as 30-June-2009, and in another as 06/30/2009. It makes no sense to speak of
"storing the date in medium date format".

If you really want to annoy your users you can use a fixed length format such
as mm/dd/yyyy and use an Input Mask "00/00/0000" to force them to enter six
numeric digits. This will require them to type 07012009 (six keystrokes)
instead of 7/1 (three) to get exactly the same value (39995.0000000000) stored
in the table, but it will control what they enter. Input masks aren't useful
if you use a variable length format such as "May 13" or "December 21", however
- even though these are acceptable entries to a date field.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top