Clare,
Don't worry, no code needed. Assuming the form's name is Form1, the
faculty's combo name is cboFaculty and the department combo's name is
cboDept:
1. Modify the query being cboDept 's rowsource, adding the following
criterion under the Faculty field (the field has to be there, even if you
don't show it):
Forms![Form1]![cboFaculty]
2. While in form design, select cboFaculty and display properties. On tab
Events, place the cursor in the box next to event Before Update, and then
click on the little button with the three dots that appears on the right;
select Macro Builder. You will be taken to a macro design screen; add an
action Requery, and in the box next to Control Name in the lower part of the
screen, type in the name of the department combo (cboDept). Save giving a
meaningful name. You will be taken back to the form design view, save and
you're done.
Basically, what you did is: in step 1, you added a filter on the department
combo's rowsource query, so it only returns values pertaining to the
current faculty selected in the first combo. In step 2, you created a macro
that forces the dept combo to refresh and display relevant departments only,
everytime the user changes the faculty selection in the first combo.
HTH,
Nikos
Clare said:
I have a form to enter University staff details. There are 5 faculties
and each faculty has a number of departments. Rather than having one large
value list of all the departments. I would like (if possible) the department
value list to change depending on which faculty is selected.
Not sure if this is possible and I have very limited coding knowledge so
speak slowly. Thanks