W
Wierdbeard65
Hi,
Application is a simple (!) instructor scheduling app.
I have a form which is designed to allow me to select which instructors are
qualified to teach which courses. I have three tables. One with all the
instructors, one with all the courses and then a link table.
Ok, on my main form, I can select an instructor and then on a sub-form I get
a list of the courses that instructor can teach. Each record in the subform
is represented by a listbox to allow the course to be selected.
The problem is that all the courses are selectable in each record's list,
whereas I only want those courses to appear that are not already selected
elsewhere (in part to prevent duplicate entries.
I have the query for my listbox data sorted, but I need to refer to the
value of the link field, but don't know how to reference it.
At the moment, the query looks like:
Select Course.CourseID, Course.CourseTitle from Course
Order by Course.CourseTitle
When I want to have something like:
Select Course.CourseID, Course.CourseTitle from Course
Where Course.CourseID not in (Select Qualification.CourseID from
Qualification where Qualification.InstructorID = <linkfield>)
Order by Course.CourseTitle
How do I reference the linkfield to get the current instructor?
TIA
Application is a simple (!) instructor scheduling app.
I have a form which is designed to allow me to select which instructors are
qualified to teach which courses. I have three tables. One with all the
instructors, one with all the courses and then a link table.
Ok, on my main form, I can select an instructor and then on a sub-form I get
a list of the courses that instructor can teach. Each record in the subform
is represented by a listbox to allow the course to be selected.
The problem is that all the courses are selectable in each record's list,
whereas I only want those courses to appear that are not already selected
elsewhere (in part to prevent duplicate entries.
I have the query for my listbox data sorted, but I need to refer to the
value of the link field, but don't know how to reference it.
At the moment, the query looks like:
Select Course.CourseID, Course.CourseTitle from Course
Order by Course.CourseTitle
When I want to have something like:
Select Course.CourseID, Course.CourseTitle from Course
Where Course.CourseID not in (Select Qualification.CourseID from
Qualification where Qualification.InstructorID = <linkfield>)
Order by Course.CourseTitle
How do I reference the linkfield to get the current instructor?
TIA