time entry restriction

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
 
G

Guest

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?
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Time Query 7
Date format automatically changed 1
date format 2
separating date and time 5
date and time difference 19
Formatting time 2
Create a chart of totals over time? 1
Average Time for Specific Item 9

Top