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!
Microsoft Access

Avatar of undefined
Last Comment
Jeremy Campbell
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of mbizup
mbizup
Flag of Kazakhstan image

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!
Avatar of mbizup
mbizup
Flag of Kazakhstan image

<< to filter out my query on EmpBasic? >>

I was reading that backwards.  Sorry about that.

Glad you worked it out.
Avatar of Jeremy Campbell

ASKER

No problem.. It got the job done!

Thanks for the prompt help!
Microsoft Access
Microsoft Access

Microsoft Access is a rapid application development (RAD) relational database tool. Access can be used for both desktop and web-based applications, and uses VBA (Visual Basic for Applications) as its coding language.

226K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo