Data Validation Question???

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

Jonathan Smith

I am using Access 2002, with an Access 2000 Format.

I have a form that requires Input of Date, Start Time and End Time.

I need to make sure that no Therapist enters the Same Date, Start Time and
End Time Twice.

Further, I do not want them to be able to Enter a Time on the Same Date
that is between a Previously Entered Start Time and a Previously Entered
End Time.

Any Ideas?????
 
Two appointments overlap if:
A begins before B ends AND
B begins before A ends.

Use the BeforeUpdate event of the form to create a Where string testing for
that condition, and use it in the 3rd argument of DLookup() to see if there
is such an appointment already.

The logic would be easier if you used 2 fields instead of 3, i.e. a
StartDateTime field, and an EndDateTime. (This also copes with appointments
that end after midnight.)
 
Back
Top