r/MicrosoftAccess • • Aug 24 '18

Booking system accesd

I want to create an MS Access VBA DCount

I have created a variable called count

It is looking for how many booking numbers ae returned from the table bookings based on the values entered into a subform – I cannot seem to get the syntax correct for the values to look up

count = DCount("BookingNo", "tbl_Bookings", “*****”)

The form is called frm_Bookings with a subform called frm_FacilityBookingSubform where the data will be entered.

I want it to look in the table and find any Date of Use value that matches the one in the subform

AND

I want it to look in the table and find any Start Time of Booking value that is between the start time entered into the subform – 1 and the end time entered into the subform

AND

I want it to look in the table and find any End Time of Booking value that is between the start time entered into the subform and the end time entered into the subform

AND

I want it to look in the table and find any FacilityName value that matches the one in the subform

The point is to ensure that a double booking cannot take place.

The field names are:

BookingNo

Date of Use

Start Time of Booking

End Time of Booking

FacilityName

0 Upvotes

0 comments sorted by