year field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I was wondering how would be the best way to check for a valid year field on a form

Rodney
 
rodney said:
I was wondering how would be the best way to check
for a valid year field on a form?


Is this ever a vague question or what. What do you think is
a "valid" year?

Access date fields accept dates from 1/1/100 to 12/31/9999,
so if that's all you want then the IsDate function will
probably do it.

If you want to limit dates to a small range, then you could
use the text box's Validation Rule property to check if the
date is in the allowable range.

. . .
. . .
. . .

Maybe you could provide more details so we don't have to
speculate about whatever it is you're looking to do here.
 
Ok, I have a year field where I want a user to put in a 4-digit year. I guess I'll use the range 1900-9999.
 
rodchar said:
Ok, I have a year field where I want a user to put in a 4-digit year. I guess I'll use the range 1900-9999.


In that case, either the form text box's or the table
field's Validation rule can be used (normally the table
field is where this should be enforced).

Just it to: Between 1900 And 9999

Don't forget to set the Validation Text property to the
error message you want to see when an invlaid year is used.

Is there really any chance you will have valid data beyond
the 21st century?
 
Back
Top