Results 1 to 7 of 7
  1. #1
    bubbu is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2020
    Posts
    3

    Rack for hotel management

    Hi All,

    is anyone could help me on how to create a rack for hotel management ?
    Since I can't afford VB, with macros results unuseful to achieve too.

    I have a table "reservation" with exemple fields: name, dateIn, dateOut
    I want create / transfer into "rack" table the name of the guest repeated as many time as the result from difference dateOut-dateIn . Beside the guest's name, each record have to contain the dates from dateIn to dateIn+1, dateIn+2, ..., dateOut

    Exemple:
    Table "reservation" record: pippo , datain:25/7/2020 dataout:30/7/2020
    Table "Rack" records:
    date:25/7/20 pippo
    date:26/7/20 pippo
    date:27/7/20 pippo
    date:28/7/20 pippo
    date:29/7/20 pippo



    Thanks

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    I don't understand Rack. But here are links that may be relevant to you.

    sample room reservation
    PBaldy Overlap

  3. #3
    bubbu is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2020
    Posts
    3
    thks, I'm gona check those !!

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Code:
    docmd.setwarnings false
    
    
    vDat = txtStartDate
    vEndDate = txtEndDate
    vName = txtName
    
    
    while vDat <= vEndDate
      sSql =  "insert into table (DateFld,Client) values (#" & vDat & "#,'" & vName & "')"
      docmd.runSql sSql
      vDat = DateAdd("d",1,vDat)
    wend
    
    
    docmd.setwarnings true

  5. #5
    bubbu is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2020
    Posts
    3
    Many tks Ranman,
    have I to put your code into a VB code, in a module or a class module ?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Could put code in button click event.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    You can achieve this without code, but with an auxiliary table that has a field with consecutive numbers from 0 to n (30 in example below), as seems below:

    Click image for larger version. 

Name:	Rack.JPG 
Views:	18 
Size:	57.2 KB 
ID:	42286

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

Similar Threads

  1. Seeking Help Designing Hotel PMS
    By jasgra2015 in forum Database Design
    Replies: 6
    Last Post: 06-10-2018, 09:51 AM
  2. Hotel to filter in Report
    By Erictsang in forum Reports
    Replies: 1
    Last Post: 09-20-2017, 07:46 AM
  3. Hotel Availability
    By masterdaave in forum Queries
    Replies: 4
    Last Post: 01-26-2015, 06:47 PM
  4. Hotel database
    By femiores in forum Database Design
    Replies: 1
    Last Post: 03-24-2012, 01:13 PM
  5. hotel reservation, please help
    By forgotten in forum Database Design
    Replies: 1
    Last Post: 08-12-2009, 10:30 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