Date Validation Question

J

jerseygirl

I’m working on an expense tracking database, and it has several date fields.
I would like to set up validations for these fields. For example, the
InvoiceDate needs to be < or = today, and the DateReceived needs to be > or =
InvoiceDate, and < or = today.

I’ve never used validations before.

Any suggestions?

Thank you!

-Jerseygirl
 
R

Rick Brandt

jerseygirl said:
I'm working on an expense tracking database, and it has several date
fields. I would like to set up validations for these fields. For
example, the InvoiceDate needs to be < or = today, and the
DateReceived needs to be > or = InvoiceDate, and < or = today.

I've never used validations before.

In the ValidationRule property for InvoiceDate enter...

< Date()

....or if it's not a required field...

< Date() Or Is Null

For the ValidationRule of DateRecieved...
= InvoiceDate() And <= Date()

or if it's not a required field...

(>= InvoiceDate() And <= Date()) Or Is Null
 
R

Rick B

you pretty much have it there. Just put the rule in the control's
VALIDATION in the properties box...

For invoice date, just put... <Date() or = Date()

For date rec'd just put... (>[InvoiceDate] or =InvoiceDate()) and (< Date()
or = Date())



I did not test those, but I think that if you enter them you will get the
results you want.
 
O

Ofer

If you want to set the validation in the table then there are two options
open the table in design view.
for the validation against a date() go to the proprty of the field, in the
ValidationRule property enter <=date(), and in the ValidationText Property
enter the message you want to be displayed when the value will be bigger then
date()

For the validation of a field against another field, open the table in
design view, display the properties of the table, in the ValidationRule
enter [field1]>[field2], and in the ValidationText enter the text you want to
be displayed.

now if you want to check the values from a form, then let me know
 
Top