Quote:
if a room has been booked, then I need the button with the room number on it to turn red and cannot be selected. However, I also need the button to be red with the time in-between the date in and date out.
Looks like your statement is missing something big.
Say that on Saturday, rooms 1 to 10 are booked, and on Sunday, rooms 10 to 15 are booked.
With your statement, you can't book a room for those 2 days because no room is available over this period.
The solution you are missing is the feature to move a booking on Sunday to another room, which free a room for those 2 days.
For more than 2 nights, you may have to move more bookings in order to free a room over the period.
----
str1 = ("SELECT * FROM [BookingInformation] WHERE [Date In] = #" & dtpDateIn.Value.Date & "#")
Not a solution to your question, but another problem you have.
Never build an SQL query by concatenating strings. Sooner or later, you will do it with user inputs, and this opens door to a vulnerability named "SQL injection", it is dangerous for your database and error prone.
A single quote in a name and your program crash. If a user input a name like "Brian O'Conner" can crash your app, it is an SQL injection vulnerability, and the crash is the least of the problems, a malicious user input and it is promoted to SQL commands with all credentials.
SQL injection - Wikipedia[
^]
SQL Injection[
^]
SQL Injection Attacks by Example[
^]
PHP: SQL Injection - Manual[
^]
SQL Injection Prevention Cheat Sheet - OWASP[
^]