Filter form based on another table

pesto

Registered User.
Local time
Today, 12:50
Joined
Mar 8, 2005
Messages
11
I have one form I'd like to filter, and three tables.

Tables: Students, Hosts, Matches

Form: Students (pulls data directly from the Students table)

Matches is a junction table between Hosts and Students. I'd like to filter the Students form such that only those records show up that have no corresponding records in the Matches table.

I can create a query doing this easily enough.

Code:
SELECT Students.ID
FROM Students LEFT JOIN Matches ON Students.ID = Matches.StudentID
WHERE Matches.StudentID is null

But when I try to use this as a filter for the Students form, it doesn't work.

Help?
 
Not 100% sure it will work, may be an Oracle solution... but...
Select Students.ID
From Students
where students.ID not in (Select StudentID from Matches)
 
You're a genius. Thank you.
 

Users who are viewing this thread

Back
Top Bottom