Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I limit the imput of a field to the current year?

Status
Not open for further replies.

phatbeno

Technical User
Jul 20, 2003
2
AU
How do I limit the imput of a field to the current year??? Even better, can I make it automatically inserted each time???

Thanks
 
Since this is the Access Tables (and Relationships) forum, I'll assume you're talking about entering dates into a table datasheet, as opposed to entering them into a form.

You can use a field validation rule to test values being entered into the field. For example, to limit input dates to the current year, set the Validation Rule of the field to:
Year(fieldname) = Year(Date)

To limit input dates to the last full year, use:
Between Date() And DateAdd("yyyy", -1, Date)

I think that, in general, if you enter just the month and day, Access will supply the current year.

Rick Sprague
Want the best answers? See faq181-2886
To write a program from scratch, first create the universe. - Paraphrased from Albert Einstein
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top