chrisgunny
Registered User.
- Local time
- Today, 14:59
- Joined
- Apr 6, 2013
- Messages
- 16
Hi All,
Really need some help with code to prevent double booking in my database I was planning on using the BeforeUpdate function on the data entry form, the details are:
I have a table called "BookingsT" it contains the following fields the code needs to work with:
"RequestedDateFrom" - Date Field
"RequestedDateTo" - Date Field
"AssetID" - Number field which is pulled from "AssetT" table which lists my assets, the form inputs the number from the asset description which the user selects in the form.
"BookingCancelled" Yes/No field when yes the code should ignore these records.
The logic is simple:
If someone books Asset 1 between 15-4-13 and 16-4-13, someone cant then book asset 1 between 16-4-13 and 17-4-13, however if the first booking is cancelled then someone can book asset one from 15-4-13 or 16-4-13.
Hope thats enough info, any help would be great.
Really need some help with code to prevent double booking in my database I was planning on using the BeforeUpdate function on the data entry form, the details are:
I have a table called "BookingsT" it contains the following fields the code needs to work with:
"RequestedDateFrom" - Date Field
"RequestedDateTo" - Date Field
"AssetID" - Number field which is pulled from "AssetT" table which lists my assets, the form inputs the number from the asset description which the user selects in the form.
"BookingCancelled" Yes/No field when yes the code should ignore these records.
The logic is simple:
If someone books Asset 1 between 15-4-13 and 16-4-13, someone cant then book asset 1 between 16-4-13 and 17-4-13, however if the first booking is cancelled then someone can book asset one from 15-4-13 or 16-4-13.
Hope thats enough info, any help would be great.