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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preventing backdated entries in the date field

Status
Not open for further replies.

stc

Technical User
Aug 23, 2001
25
GB
Hi,

Not knowing Access 97 particularly well, I am finding it difficult to solve this problem. I have a form which allows users to insert booking details, including the date on which a booking will take place. I want to be able to prevent a user from putting in a date that is in the past, and to generate a self-written error message to tell them they can't do this.

Any help greatly appreciated!
 
Open the form in design mode. Right-click on the text field that is your date-entry field. In the properties box look for 'Validation rule' and 'Validation text' lines. In rule enter something like ">=Date()" which means date entered must be greater than or equal to today's date. In validation text enter your message, e.g. "Date must be greater than or equal to today's date.". Save and try it. If you have any questions search Access Help under these topics or put your cursor on the appropriate property field and click F1.
 
Thanks very much - have got this working now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top