Hi everyone. It's been a while since I had to consult with Bytes and I have missed my buddies! (You know who you are!) :-)
I have an access database that I use to run my rental management company and I have several condos. I had my first double booking last weekend due to a typo so it's time I set my software to help me.
I have reviewed numerous posts and threads here...one was very close but I still felt like I need more help.
The data dumps into tblBookings. My input form is frmBookings.
My fields are
Arrival (Date/Time)
Departure (Date/Time)
Condo (short text)
When I enter data into all three fields, I want to click a button (btnCheckDates) and have it check the table for any overlapping dates for that particular Condo.
Most of the threads are just checking the first and last dates...but it's more complex.
Here is what I mean:
Say there is an existing reservation Jan. 1-Jan 5.
Any of these scenarios would be a double booking:
Dec. 31 - Jan. 2
Jan. 2-Jan. 4
Jan 3-Jan 8
Dec. 31-Jan 7
So as you can see the new record arrival date could be greater than or less than the existing arrival date.
The new departure date could be greater or less than the existing departure date.
The entire series could be outside the gap.
The entire series could be inside the gap.
And Arrival date CAN be on a Departure date. A Departure date CAN be on an arrival date.
I want to click the button, and if a date overlaps, I just want a message box that says "Double Booking."
My code writing skills are basically non-existent. But I do know my way around access fairly well by now (thanks all to Bytes!)
I am scared to death of this thread!!! But I'm ready! Who can help me?!