Show number of booked items in time units in listbox (thread 2)

  • I am in the process of making a Booking System for a NetCafe. (All code is put together from what I have found on YouTube and Google - that my "level")

    My starting point is a userform frmBooking which is used to register the customer.

    In userform frmBooking you can delete, correct and display customer data.

    If the customer wants to buy goods in the Café, the customer is marked in the listbox in userform frmBooking and with a button, customerdata is transferred to userform frmRegning.

    In userform frmRegning, goods are selected which are stored in the sheet "VareDatabase" with the option of printing. So far so good.

    The challenge is the status of booked computers.

    The best solution would be to be able to search the status of booked computers in connection with customer registration with a search button.

    Viewing booked computers in a listbox tab 2 - in userform frmBooking will be optimal (but I can not finde code for that) - alternative in userform frmReservation.

    Search data is 'Date' and 'Room' independent of each other.

    All data regarding the Café is registered in the sheet "VareDatabase"

    All other information is registered in the sheet "Database".

    /Lars DK


    1. most code i have found on youtube and google and so far a little OzGrid.


    • pasted-from-clipboard.png
    • pasted-from-clipboard.png


  • Just because code is on YouTube doesn't mean it's good code. There's so many different styles of code it's difficult to follow.

    I can't see how to tell if a computer is booked or not, nor how you would. How do you want to view the status?

    I can't see why you need 3 UserForms. If you want to view a specific record from the Booking form I would have the data loaded into TextBoxes by clicking the record in the ListBox.

    I think the only way to get help is to tackle this one part at a time.

  • Your code cannot be compared with youtube code. You code is very consentrate. I like it.

    Based on the number of participants, date and periodtime 'from' and 'to' - I know how many computers are booked every hour.

    This calculation appears from code in "Modules" and is displayed in "Database".

    The code you made for me, informs me, hour by hour, how many computers were booked and is displayed in listbox frmReservation. If it is possible to move the view to the listbox in frmBooking as a tab 2, there is no need to have a third userform frmReservation - that is correct. In userform frmBooking, the number of participants, date, time period 'from' and 'to' ... is already registered in advance ... so it is only a question of in which room there is available capacity. I need to see whole days in the listbox every time I change rooms. The reason is that you must be able to offer an alternative time period if everything is booked.

    If the pic Booked Computer cut be a part of pic listbox in frmBooking as a tab 2 ... I think is will be perfect

  • Check this is working as expected.

    The userform is very slow loading. I'm not sure if it is down to creating the Named Ranges. I wouldn't bother with Named Ranges, but set the range in the code

  • Hi Roy
    Sorry, but I do not think I understand your message.
    The file is similar to the file I sent and contains the same error that I can not open the third userform frmReservation with the "Computer" button.

    I also do not see any MultiPage on frmBooking as a replacement for userform frmReservation. Am I doing something wrong?
    Regards Lars

  • Hi Roy ... No pressure

    I'm overly impressed with what you've already done for me. Once again thank you.

    I have inserted a MultiPage in userform frmBooking in new attachment.

    The two comboboxes and search button can be dispensed with, if the listbox is automatically updated when I select the room and enter the date (above) in connection with the registration of the customer. Then I will immediately be able to see free time. I do not know if it is possible!


  • Hi Roy

    I have chosen to re-use the code where I show all columns in listbox lstDatabase (Page 1) - (where 'ColumnWidths' determines which columns to show) - to display the columns I need in listbox MyListbox (Page 2)

    My next step is,

    When I enter a Date (textbox), at the top of userform frmBOOKING, the display of rows in the listbox MyListbox (Page 2) is reduced to the rows that have the same Date.

    When I select a Rum/Room (combobox) at the top, in userform frmBOOKING, the display of rows in listbox MyListbox (Page 2) is reduced to the rows that have the same Rum/Room.

    Date and Room must be independent of each other - I must be able to select Room before Date.

    Do you have the opportunity to help me with that challenge?

    Regards Lars