Combo Box Query

  • Thread starter Thread starter David Tunstall
  • Start date Start date
D

David Tunstall

Please help,

I have a combo box in a subform that lists qualificatins
that students can do - Communication, Problem Solving,
IT, Application of Number......

The combo box is in a subform with Continuous Forms view,
so when the user selects a qualification that the student
has completed, the next combo box becomes available.

What I want to be able to do is say a user selects
Communication as the first qualification in combo box
one, when the second combo box appears for the next
qualification, I don't want Communication to be an
option. So gradually as the student gains qualifications,
the combo box will list only ones that he / she hasn't
yet completed.

Hope this makes sense.

Thanks
David
 
Assuming that the list of qualification is stored in a field 'Qualification'
in a table called tblQualifications and the source of the subform is
tblSudentQualifications, with fields StudentID, StuQualification:
Create a query as follows:
SELECT StuQualification FROM tblStudentQualifications Where StudentID =
Forms!YourForm!StudentID AND StuQualification <>
Forms!YourForm!YourSubform!StuQualification
Save it as qryStuQuals (or whatever you like).

Use the following sql as the source for your combo:
SELECT tblQualification.Qualification FROM tblQualifications LEFT JOIN ON
tblQualification.Qualification = qryStuQuals.StuQualification WHERE
qryStuQuals.StuQualification Is Null

In the onCurrent event of your subform add the code:
Me!yourCombo.Requery.

HTH
 
Back
Top