I have been reviewing previous posts covering this subject but can't seem to find any with my "unique" issue. I have a table [Orders] used to track employee's appointments. We use a form [frmOrders] to update the data in this table. On this form we have theses fields:
EmployeeID
Event
Start Date
End Date
plus several others that do not apply to this discussion. I am trying to come up with a way to prevent conflicting appointments. If I use a unique pk combination it only works if all of the fields are identical. My problem comes in when someone tries to enter an employee into an event that is between the start and end dates. For example:
Employee A is on vacation from 1/1/2009 to 1/12/2009. Supervisor B wants to schedule a training class for Employee A on 1/5/2009. No conflict will show as the start and end dates don't match.
What we want is after those fields are input into the form:
1) identify if there is a conflict of employee and dates
2) pop up a screen warning of a possible conflict
3) allow the conflict at the supervisors discretion as there are circumstances where an employee will have multiple events that occur.
Any help will be appreciated.
EmployeeID
Event
Start Date
End Date
plus several others that do not apply to this discussion. I am trying to come up with a way to prevent conflicting appointments. If I use a unique pk combination it only works if all of the fields are identical. My problem comes in when someone tries to enter an employee into an event that is between the start and end dates. For example:
Employee A is on vacation from 1/1/2009 to 1/12/2009. Supervisor B wants to schedule a training class for Employee A on 1/5/2009. No conflict will show as the start and end dates don't match.
What we want is after those fields are input into the form:
1) identify if there is a conflict of employee and dates
2) pop up a screen warning of a possible conflict
3) allow the conflict at the supervisors discretion as there are circumstances where an employee will have multiple events that occur.
Any help will be appreciated.