Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    1

    Question Unanswered: Need to Verify Dates so no duplicate registrations are mde

    Help please.

    I have a project I'm doing for college. It's an Access database about a bed and breakfast. My problem:

    I have Check_In_Date and Check_Out_Date fields in my reservations table. I want to be able to put registration data in a form -- like a GuestID and then put in a check-in date and a check-out date for a particular room. If that room is already reserved for that time period, I want an error message.

    The data for the reservation itself is in a table that is attached to a registration form.

    Any ideas? Thank you.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    There's a bunch of ways to do this, one would be to pull a DCount() with the room number, and dates as criteria... eg:

    If DCount("yourRoom", "reservations", yourDate & " BETWEEN check_in_date AND check_out_date) > 0 Then
    room is reserved
    End If
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •