Hi
I have a form named frmAppointments - currently it uses tblAppointments as its control source, but I could change to a query if it helps.
Amongst the fields I have for this form are txtAppointmentDate which is a date field, formatted to short date, and a list box named lstTimes
whose control source is tblAppointmentTimes.lstTimes. (This table has two fields an ID field and one for times at quarter hour intervals)
The idea is that the member of staff, when booking an appointment, first selects the date and then an appointment time for that date.
The system works as intended but currently there is a potential danger of duplicate appointments What I need is some VBA code, possibly on the OnClick event
of lstTimes that checks to see whether, on that particular date, another appointment has been scheduled for the same time. If so this would then have a
MsgBox advising of the same and asking them to select a new appointment time. Presumably followed by a set focus returning to lstTimes.
Can anyone assist me to overcome this problem?
Any assistance would be greatly appreciated.
Regards
Cheyanne