MackMan
Registered User.
- Local time
- Today, 11:50
- Joined
- Nov 25, 2014
- Messages
- 174
Hi all. o/
Bit of a difficult one to explain (I think).
However... I have a theory on how I can get around this, but was wondering if anyone had any advice on a way that's easier.
I have a very simple Union Query which lists all entries in a couple of tables for meeting room bookings.
RoomID, FstBookDate, LstBookDate Type.
-------------------------------------------------
1 19/10/2016 21/10/2016 Booking
1 23/10/2016 25/10/2016 Booking
1 06/01/2017 09/01/2017 Maintenance
2 24/08/2016 27/08/2016 Booking
And so on...
I'm trying to come up with an way, that when a user starts a new booking and types a date in the FstBookdate (Date from) and using beforeupdate, have access look at the query and check to see each record, and cancel the entry should it fall within the list of dates.
For example, Meeting room 1 and user types in 24/10/2016 for the DateFrom, I need a msgbox and a cancel event as it's already booked on that day.
Am I right in thinking I'll need DAO with recordset and cycle each record in turn and return a true, if start date is greater than and less that the dates in each record?
Or is there an easier way?
Any advice as always is appreciated.
Bit of a difficult one to explain (I think).
However... I have a theory on how I can get around this, but was wondering if anyone had any advice on a way that's easier.
I have a very simple Union Query which lists all entries in a couple of tables for meeting room bookings.
RoomID, FstBookDate, LstBookDate Type.
-------------------------------------------------
1 19/10/2016 21/10/2016 Booking
1 23/10/2016 25/10/2016 Booking
1 06/01/2017 09/01/2017 Maintenance
2 24/08/2016 27/08/2016 Booking
And so on...
I'm trying to come up with an way, that when a user starts a new booking and types a date in the FstBookdate (Date from) and using beforeupdate, have access look at the query and check to see each record, and cancel the entry should it fall within the list of dates.
For example, Meeting room 1 and user types in 24/10/2016 for the DateFrom, I need a msgbox and a cancel event as it's already booked on that day.
Am I right in thinking I'll need DAO with recordset and cycle each record in turn and return a true, if start date is greater than and less that the dates in each record?
Or is there an easier way?
Any advice as always is appreciated.