Evening everyone,
New to the forums and also new to the vba world. I'm hoping someone may be able to direct me on how I am able to achieve this.
Currently I'm trying to create a quick appointment schedule.
We allow for 15 minute appointments between the hours of 2:00 PM and 4:00 PM.
I would like it if someone chose the appointment time 2:15 PM within the combo box, it would not show up again for that day unless that appointment was deleted.
I've had some help with the code below, but I am unable to get it to only recognize 1 time slot per day. This code allows me to select 2:15 multiple times.
Code:
Sub cboTime_enter()
Dim dteTime As Date
Me.cboTime.RowSource = ""
dteTime = #2:00:00 PM#
Do While dteTime <= #4:00:00 PM#
If dteTime <= Time() Then
Me.cboTime.AddItem Format(dteTime, "h:nn AMPM")
End If
dteTime = DateAdd("n", 15, dteTime)
Loop
End Sub
Any assistance is appreciated.
Thanks.