Disabling controls on a form dependent on a calendar control

D

Debbie D.

Disabling controls on a form dependent on a pick date calendar control text box

I have inherited a half completed database, the purpose of the database is
for students to book a date and time for a test simulation. Tests can only
be taken at the following days/times and last 45mins:
Mondays: 11:30 to 12:30 and 12:30 to 13:30
Thursdays: 17:00 to 18:00, 18:00 to 19:00 and 19:00 to 20:00

I have a Main form: Appointments and a sub form: Appointments_Sub

The main form: Appointments contains a pick date calendar control to select
a future date on either a Monday or Thursday, this control is named:
FilterDate. A combo box named: FilterWorkstationID allows the student to
select one of 10 PC’s used for testing. These controls are based in the
‘Header Section’ of the main form.

After completing the above a student then selects their name and student ID
from a combo box named: CustID in the sub form: Appointments_Sub. My problem
is this. All the differing time slots are able to choose from enabling
erroneous input for a student i.e. the forms shows five the separate times


11:30 (Appointments_Sub1) (combo: CustID)
12:30 (Appointments_Sub2) (combo: CustID)
17:00 (Appointments_Sub3) (combo: CustID)
18:00 (Appointments_Sub4) (combo: CustID)
19:00 (Appointments_Sub5) (combo: CustID)

Using a table validation rule where the data is stored, I am able to prevent
a student not selecting an incorrect date for testing outside of a Monday or
Thursday as follows:
[ApptDate]>=Date() And Weekday([ApptDate])=2 Or Weekday([ApptDate])=5

However I would like to redefine the form so that if the date chosen from
the calendar control: FilterDate on the main form Appointments is a Monday
then the combo control: CustID is disabled for the 17:00, 18:00 and 19:00
time slots so that a student cannot input their student IDs for testing at
incorrect times. The earlier times of 11:30 and 12:30 should be allowed for
selection. Of course the opposite would apply to a Thursday, disabling the
lower end times yet still have available the later time slots.

Would I need to code this and if so where would I place it? Many thanks for
taking the time to read this and any help/advise is appreciated. I have
uploaded the ‘half cooked’ database to the following address if this helps!!!
Thank you.

http://www.blackburncollege.plus.com/access/

Debbie Duerden
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top