time entry restriction

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

Guest

Need help establishing a validation rule for time entry into my table from a
form. I want to restrict individuals from entering time/date less than 12
hours current time/date.

example:

MM/DD/YY HH:MM --- 09/10/07 07:00 AM they could only enter time back
through 09/09/07 07:00 PM

Thanks in advance Jen
 
SteveM -

I put this under the validation rule on the property of the time/date field
but it still allows me to enter dates of 2006. Where exactly should I place
the rule?
 
You put >DateAdd("h",-12,Now()) in the ValidationRule property of the control
that represents your datetime field. You can still input datetimes outside
that range but you should not be able to leave the control untill it passes
validation.

If you want to do it this way, you should also include a message in the
ValidationText property. This displays if validation fails.

Alternatively, you can use the control's BeforeUpdate event and compare the
value using the same expression there.

Steve
 
Back
Top