Results 1 to 6 of 6
  1. #1
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79

    Event system - prevent double booking using one date and start time with end time

    Hi everyone,


    so i created a system to have events booked, and i am trying to check time availability of the event room available, but i dont know what wrong. it either my query or vba code. i have attached the attachment, could someone please have a look and guide me the right direction.

    thanks alot

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Its seems you would need logic to test the room date/time values.
    A query to pull the Room Start date/time and End date/time.

    If your attempt to Book the same room falls inside this range, it needs to throw an error to prevent it.
    Or if it falls outside the range, just book it.

  3. #3
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79
    yes this is one way, but i want the listbox to show available events rooms at available times. it similar to hotel booking but the difference is instead of two dates, it one dates with two times

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    EVERY time has a date. That's how the field is built.
    If you did not save the date in the field, then you must fake it by concatinating a date to the time to perform the time math.

  5. #5
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79
    am sorry it all getting confusing, what if i have two date fields with time combined, will that work, am trying to get the query work to show availability of events rooms before implementing it in the forms

  6. #6
    princess12 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    79
    basically this is the query in which am trying to change to have datebooked, time started, time finished, according to my attached database am doing something wrong that why is not working.

    this query shows for rooms reserved which is then used on vba to check for available rooms.
    PARAMETERS [Forms]![frmSearch]![txtEndDate] DateTime, [Forms]![frmSearch]![txtStartDate] DateTime;
    SELECT Booking.Room, Booking.StartDate, Booking.EndDate
    FROM Booking
    WHERE Booking.StartDate<=Forms!frmSearch!txtEndDate And Booking.EndDate>=Forms!frmSearch!txtStartDate;

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 06-07-2013, 08:23 AM
  2. Replies: 42
    Last Post: 03-01-2013, 06:58 AM
  3. Replies: 9
    Last Post: 06-08-2012, 07:11 PM
  4. prevent double booking!! help!
    By Jean-Daniel in forum Access
    Replies: 5
    Last Post: 05-16-2012, 06:09 AM
  5. Replies: 7
    Last Post: 08-04-2011, 07:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums