Query or Macro???

S

sandyL

I am trying to make a database and one field is a list of supervisors, I
would like the list of employees that report to that supervisor to show up.
I have two tables.

table 1
supervisors #
supervisors name

table 2
employees name
supervisor #

What I would really like is to be able to click on the supervisors name and
the next field on the form would open the lookup with only the employees that
report to that supervisor.

Please help
thanks
 
M

Michel Walsh

You can put, as row source of a List box control, the an SQL
statement:looking like:


SELECT [employee name]
FROM table2 INNER JOIN table1
ON table1.[supervisor#] = table2.[supervisor#]
WHERE [supervisor name]=
FORMS!formNameHere!ControlNameHereWithSupervisorNameAsData



Hoping it may help,
Vanderghast, Access MVP
 
Top