Hey all,
This seems to be the final piece to my puzzle but I'm not very experienced in queries yet. I've been researching for days now and hope someone here can shed some light on what I can do to accomplish this.
Currently my setup is like so;
ACCDB file attached to thread should anyone like to take a peek.
tblAppointmentHoursDaily
| Show | Hours |
| Checkbox | 2:00 PM |
| Checkbox | 2:30 PM |
| Checkbox | 3:00 PM |
| Checkbox | 3:30 PM |
tblAppointments
* | TimeStamp | | AppointmentDate | AppointmentTime | UserID |
qAppointmentHoursAvailability (I was assisted with this query but can't seem to tweak it just right)
frmMain
* cboAvailability
*Runs the qAppointmentHoursAvailability query and displays available appointment times for that day. If the user selects 2:00 PM, the field is refreshed using Me.Recalc so that it reserves the time in the record.
txtAppointmentDate
I think this is another point where I'm stuck. Control Source is tblAppointments.AppointmentDate. I believe the issue may be also with the Me.Recalc of the cboAvailability. When that recalcs it also stores the changed date into the record and may now affect the query.
What I would like to happen is that when a user books a time, say 2:00 PM TODAY, no one else can select that time. But if the user changes the date field to TOMORROW, 2:00 PM is in the cbo dropdown.
Does this make sense?
Any advice would be appreciated.
ACCDB file attached. It's tiny. I've tried to remove all non important records for this query.
Cheers,
k3ll1n
This seems to be the final piece to my puzzle but I'm not very experienced in queries yet. I've been researching for days now and hope someone here can shed some light on what I can do to accomplish this.
Currently my setup is like so;
ACCDB file attached to thread should anyone like to take a peek.
tblAppointmentHoursDaily
| Show | Hours |
| Checkbox | 2:00 PM |
| Checkbox | 2:30 PM |
| Checkbox | 3:00 PM |
| Checkbox | 3:30 PM |
tblAppointments
* | TimeStamp | | AppointmentDate | AppointmentTime | UserID |
qAppointmentHoursAvailability (I was assisted with this query but can't seem to tweak it just right)
Code:
SELECT DISTINCT tblAppointmentHoursDaily.HoursFROM tblAppointmentHoursDaily LEFT JOIN tblAppointments ON tblAppointmentHoursDaily.[Hours] = tblAppointments.AppointmentTime
WHERE (((tblAppointments.AppointmentDate)<> Date() Or (tblAppointments.AppointmentDate) Is Null) AND ((tblAppointmentHoursDaily.Show)=True));
frmMain
* cboAvailability
*Runs the qAppointmentHoursAvailability query and displays available appointment times for that day. If the user selects 2:00 PM, the field is refreshed using Me.Recalc so that it reserves the time in the record.
txtAppointmentDate
I think this is another point where I'm stuck. Control Source is tblAppointments.AppointmentDate. I believe the issue may be also with the Me.Recalc of the cboAvailability. When that recalcs it also stores the changed date into the record and may now affect the query.
What I would like to happen is that when a user books a time, say 2:00 PM TODAY, no one else can select that time. But if the user changes the date field to TOMORROW, 2:00 PM is in the cbo dropdown.
Does this make sense?
Any advice would be appreciated.
ACCDB file attached. It's tiny. I've tried to remove all non important records for this query.
Cheers,
k3ll1n