Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use Query Result as criteria for a second query

Status
Not open for further replies.

kieriosity

IS-IT--Management
Sep 9, 2002
8
0
0
US
OK, here is my situation. I have a table with a list of courses a student can take. In the same table is another field that lists the prerequisite course, if there is any.

Now, there is a form that I've created that allows the user to add eligible students to a class (the class is related to the course in a many-to-one relationship; many classes can have only one course). It generates a list of eligble students based on several criteria: student is excluded if they have attended the class before, student is excluded if they are already selected for the same course but different class, and student has taken the required prerequisite.

I've got the first to part working, but I cannot get the prerequisite part. I know how to do it if I can extract the prereq's course number, but that is the trouble I am having:
I can't find a way to dynamically extract the prerequisite's course ID to use in a query that I have.

To clarify:

1.) The form has a field that contains a list of classes. 2.) When the user selects a class, a list of eligble students will appear (and all do except prereq are not checked). I'm using an after update event to trigger the code.

I want to use the course, which is also tied to the class in the dropdown list, to get the prerequisite value from the courses table and then use that value in a separate query. The problem is, I don't know how to do it. Any Advise? Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top