Link to home
Create AccountLog in
Avatar of Jeremy Campbell
Jeremy CampbellFlag for United States of America

asked on

How to filter a query using a field from another table in access?

I have a table called EmpBasic which lists Employees. I want to run a query on that table that gets any ebEmpID filtered out based on the EmpIDs found in tblFilter.

How can I use the filter table tblFilter to filter out my query on EmpBasic?

Thanks in advance!
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Or even this, using an inner join (might be faster)

SELECT EmpBasic .* FROM EmpBasic INNER JOIN tblFilter ON EmpBasic.ebEmpID  = tblFilter.EMPID
Avatar of Jeremy Campbell

ASKER

The tblFilter actually contains a list of the EmpIDs I don't want to appear in the query.. I just changed the first example to NOT IN.

That does the job though!
<< to filter out my query on EmpBasic? >>

I was reading that backwards.  Sorry about that.

Glad you worked it out.
No problem.. It got the job done!

Thanks for the prompt help!