Ok, so this is what i believe that this code does:
Code:
' arnelgp
' The following line checks the current checkin date and compares if it is equal or earlier than the last reservation's checkout
If current_ID = rs!id And rs!CheckInDate <= last_Date Then
With Me("lblHoliday" & last_Position)
' If it is the same, it changes the width of the bar of the previous reservation by reducing it half a day plus 20
.Width = .Width - ((DAY_WIDTH \ 2) + 20)
End With
' the following code then moves the starting point of the new reservation to the right, half a day plus 20. This would leave a gap of 40 between the ending point and the starting point.
.Left = EMPLOYEE_COL_WIDTH + Abs(rs!CheckInDate > Me.CalendarStartDate) _
* DAY_WIDTH * DateDiff("d", Me.CalendarStartDate, rs!CheckInDate) + ((DAY_WIDTH \ 2) + 20)
' The following line defines the total length of the bar, but I do not understand why this is necessay as this had been done just a few lines above.
.Width = lngCtlEnd - .Left
Else
' 'end of arrnelgp
' This defines the left position of the bar that does not have a previous reservation ending the same day that this one begins.
.Left = EMPLOYEE_COL_WIDTH + Abs(rs!CheckInDate > Me.CalendarStartDate) _
* DAY_WIDTH * DateDiff("d", Me.CalendarStartDate, rs!CheckInDate)
' The following line defines the width of a reservation that does not have a ending the same day that this one begins.
.Width = lngCtlEnd - .Left
End If