Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2017
    Posts
    1

    Unanswered: Find date in records while entering in form Access VBA

    I have this hotel loyalty program with 2 simple master and child tables:

    tbl_Members_Mast: it has customer's personal info like id, name, join date, phone, email etc.
    Tbl_Checkins: which shows when these members checked in at hotel and for how many days, like:
    memberid, ci_Date, total_stay, rate

    Now, when entering new data in checkins form, how can I show the end user if check-in date is being repeated in form (if new check-in date falls in between Ci_date and check-out date. There is no checkout date, but we have total_stay nights).

    Not sure what to use and how to, DAO or dcount.
    I am new to access.
    Thank you in advance.

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    628
    Provided Answers: 32
    you dont need DAO inside Access. you just run a query.
    1st ,I'd have a field NightsReserved to store the nights the client reserved.
    but CheckIn and Checkout would show the ACTUAL nights stayed, and would get calculated via query : DateDiff("d",checkin,checkout)

  3. #3
    Join Date
    Jan 2009
    Location
    Kerala, India
    Posts
    188
    Wild-guess: ci_date + Total_Stay will give check_out_date - use the expression (ci_date+total_stay) AS Chkout_Date in a new column in query. Use the Query for viewing purposes instead of Tbl_Ceckin directly on Form.
    www.MsAccessTips.com (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

Tags for this Thread

Posting Permissions

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