I can't seem to make my collision problem work

Conoize23

Registered User.
Local time
Today, 06:23
Joined
May 27, 2016
Messages
15
hi, I am running a scheduling appointment app Screen Shot 2016-07-08 at 2.21.53 AM.jpg (the error message and the type! message are bc there are calculated labels there, so they'll fill with data when there's data entered by the employee, also they are meant to be a hidden feature for the developer(me)). that I am making for a hair salon, it's 75% done but since the start I'm having a collision problem with appoints that I don't manage to solve yet...

well, I made a function to be able to detect and validate if there is a collision when I choose a specified hour,Screen Shot 2016-07-08 at 2.28.51 AM.jpg(Even if I'm telling the program to Exit Sub, it ends up storing the new appointment on the subform) the collision would be made depending on time (i.e. 8:00-9:00 AND 8:30-9:20), but it needs to know what day is where I'm placing the specified appointment, so there are two ways where I can do this...Screen Shot 2016-07-08 at 2.26.20 AM.jpg(This is the logic)(dLowerPrecision/dUpperPrecision it'll measure if a procedure delays or ends earlier)(dDuration is the time of the procedure)(i is a variable, will store time)

I could just tell the cboTime, just count me in the hours that are available for the specified procedure(if there's time available) show me a message box saying there's a collision occurring and exiting the logic(so It can't make the appointment) Well the error message shows, but, It shows ALWAYS even if there's no new appointments in a specified day... so, I wanna know if the logic of the validation function has an error in declaring it. I'd be happy if I just make the message display and the program not adding the appointment
 
Last edited:
At least one error, you've a spell mistake, a - in strW-here in the DCount.
An another in the below, the sign < is in wrong place.
attachment.php
 

Attachments

  • InWrongPlace.jpg
    InWrongPlace.jpg
    11.6 KB · Views: 170
Last edited:
The whole syntax of the strWhere line is wrong and will evaluate to something like
#07/-08/2016# tmAppointEnd < and #07/08-/2016#> tmAppoinEnd

To avoid clashes, if the start of the appointment is before the start of any other appointment, the end of the appointment must be <= the start of any other appointment. Also need to test that for any proposed appointment where the end is after any other appointment, the start must be >= to the end of existing appointment.

See http://allenbrowne.com/appevent.html for some ideas on finding clashing events.

Also, is this a single employee establishment? If not, you should exclude appointments for other employees.
 
I got your *message* but it's 3:30 AM where I am and I am done for the night. Cronk posted a link to a GREAT sample so do look at that. I'll check back later today to see how you are doing... :D
 
Thank you all for trying to help, Cronk, I'll check your post later today, and it's linked to the employees ID, so yes, it only present data related to just one employee at a time, Gina, I get it, I stayed on late trying to find a solution for this, sorry, I was thinking you were gonna see it tommorow. :D
 
Last edited:
Hmm, status check? Have you had a chance to review the link?
 
yeah I'm working on it now, This page might help me solve my collision problem, It'll take me a bit to process how to do the logic again, maybe I'll finish it by tommorow night.
 
Last edited:
awesome!!! :D
 

Attachments

  • Screen Shot 2016-07-08 at 6.46.12 PM.jpg
    Screen Shot 2016-07-08 at 6.46.12 PM.jpg
    105.2 KB · Views: 72
Last edited:
Just replied to your eMail and once again thanks, very nice of you to do that! :D
 

Users who are viewing this thread

Back
Top Bottom