VBA Code - Prevent double booking

chrisgunny

Registered User.
Local time
Yesterday, 22:23
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.
 
Thanks...kinda helps but I am not using times and that looks far more complex than what I need - I'll keep reading until I find something that works or the penny finally drops LOL
 

Users who are viewing this thread

Back
Top Bottom