Data Validation Problem

  • Thread starter Thread starter Jonathan Smith
  • Start date Start date
J

Jonathan Smith

In an Access 2002 Environment, with Access 2000 File Format:

I have a Data Entry Form, on which Users input Date of Service, Start Time
and End Time. I would like to create the following data validation rules:

End Time must be Greater Than Start Time, and Less Than 19:00.

Start Time must be Greater Than 07:00

As of any Wednesday, I want to make All Records with a Date of
Service in the previous week uneditable.

I can figure out the First Two, but the last one is kicking my butt.

Any suggestions???
 
To insist the Start Time is after 7am, open your table in design view,
select the Start Time field, and in the lower pane, set its Validation Rule
to:
#0:07:00#

Likewise, set the Validation Rule for the End Time to:
< #0:19:00#

For the comparison between the two, use the Validation Rule for the table,
which is entered in the Properties box (View menu, in table design). The
rule would be:
[End Time] > [Start Time]

To lock the records, use the Current event procedure of your form, with
DateDiff() to calculate the difference in days, and Weekday() to adjust for
the Wednesday-starting-week. Toggle the AllowAdditions (and AllowDeletions?)
property of the form.
 
Thank you, Allen.

To insist the Start Time is after 7am, open your table in design view,
select the Start Time field, and in the lower pane, set its Validation
Rule to:
#0:07:00#

Likewise, set the Validation Rule for the End Time to:
< #0:19:00#

For the comparison between the two, use the Validation Rule for the
table, which is entered in the Properties box (View menu, in table
design). The rule would be:
[End Time] > [Start Time]

To lock the records, use the Current event procedure of your form,
with DateDiff() to calculate the difference in days, and Weekday() to
adjust for the Wednesday-starting-week. Toggle the AllowAdditions (and
AllowDeletions?) property of the form.
 
Back
Top