hedonismbot
New member
- Local time
- Today, 22:31
- Joined
- Aug 10, 2020
- Messages
- 4
Hey there everyone,
I'm an Access beginner and am currently working on a reservation system for desks. I have run into an issue with a set of If/Else statements I've implemented to try to achieve what the user requested.
If a user makes a reservation that's two days or less out from the current date- they receive a certain set of desks (qryAvailableDesks). If the user selects a reservation date that's more than two days out, they receive a separate set of desks (qryAvailableDesks2).
I've attached the following code to a button on a form to achieve this:
But, for some reason, the RowSource change isn't happening and I'm thinking it has to do with the way I've written the date calculation?
I've been stumped by this for a couple of days and it's probably because I'm thinking about this incorrectly. Any assistance would be greatly appreciated.
I'm an Access beginner and am currently working on a reservation system for desks. I have run into an issue with a set of If/Else statements I've implemented to try to achieve what the user requested.
If a user makes a reservation that's two days or less out from the current date- they receive a certain set of desks (qryAvailableDesks). If the user selects a reservation date that's more than two days out, they receive a separate set of desks (qryAvailableDesks2).
I've attached the following code to a button on a form to achieve this:
Private Sub Command108_Click()
If Me.Reservation_Date = [ReservationStartDate] <= Date + 2 Then
Me.listDeskSearch.RowSource = "qryAvailableDesks"
ElseIf Me.Reservation_Date = [ReservationStartDate] > Date + 2 Then
Me.listDeskSearch.RowSource = "qryAvailableDesks2"
End If
End Sub
But, for some reason, the RowSource change isn't happening and I'm thinking it has to do with the way I've written the date calculation?
I've been stumped by this for a couple of days and it's probably because I'm thinking about this incorrectly. Any assistance would be greatly appreciated.