Can a Combo Box Use (2) tables to pull from instead of one ???

D

Dave Elliott

On my form the combo list uses the below to select a customer from the table
customers
Can I also make it use the table employees as well
So that if I can choose from either my cutomers or employees!?!

SELECT Customers.Customers FROM Customers ORDER BY Customers.Customers;
 
J

John Vinson

On my form the combo list uses the below to select a customer from the table
customers
Can I also make it use the table employees as well
So that if I can choose from either my cutomers or employees!?!

SELECT Customers.Customers FROM Customers ORDER BY Customers.Customers;

You can use a UNION query for this purpose:

SELECT Customers.Customers FROM Customers ORDER BY Customers.Customers
UNION ALL
SELECT Employees.Employee FROM Employees ORDER BY Employees.Employee
ORDER BY 1;

Note that (unless you simplified your example) you may be in a bit of
trouble: names are NOT unique, and you could have one employee named
Jim Smith and three customers also named Jim Smith!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top