where do i start!!!
in my form i want to check if the appointment does not overlap another appointment.
the appointment is made up of items that all have an individual time allocated.
i thought of doing something like this but i am useless with syntax etc.
msgbox. this appointment is too long.
etc
etc
the only thing is that i dont know if it will work. it does in my head.
TreatmentTime = Time Field
OrderID = Foreign Key Field
OrderTime = TimeField
StartDate = Date Field
Employee = Foreign Key Field
the table is a one to many (parent/child). the OrderID is the parent. i have used a DSum to calculate the duration and the '+' is to add the start time to the duration which should leave the finish time.
then the second part '>' to see if it is greater than any other start time.
in my theory this will work but i dont know if access will search all records that have the same date.
im only guessing at this so i am looking for a way to do it.
thanks
in my form i want to check if the appointment does not overlap another appointment.
the appointment is made up of items that all have an individual time allocated.
i thought of doing something like this but i am useless with syntax etc.
PHP:
if DSum("[TreatmentTime]", tblOrdersItems, OrderID " = & " "[Forms].[frmNewAppointment].[OrderID]") + "[Forms]![frmNewAppointment]![OrderTime]" > 'any record' tblOrdersItems.StartTime where StartDate = frmNewAppointment.OrderDate and Employee = frmAppointmentTreatmentItems.Employee then
msgbox. this appointment is too long.
etc
etc
the only thing is that i dont know if it will work. it does in my head.
TreatmentTime = Time Field
OrderID = Foreign Key Field
OrderTime = TimeField
StartDate = Date Field
Employee = Foreign Key Field
the table is a one to many (parent/child). the OrderID is the parent. i have used a DSum to calculate the duration and the '+' is to add the start time to the duration which should leave the finish time.
then the second part '>' to see if it is greater than any other start time.
in my theory this will work but i dont know if access will search all records that have the same date.
im only guessing at this so i am looking for a way to do it.
thanks