List box lookup based on two tables

sfoster1

Registered User.
Local time
Today, 14:23
Joined
Nov 28, 2001
Messages
19
How would I go about having a list box lookup (in a form or table) draw upon more than one table? In other words, I want to be able to have the user, when entering data in a form, select a name from one of two different tables for one of the fields. Guessing a query would be the way to go here???
 
Probably a union query would be the way to go:

SELECT NameField
FROM FirstTable
UNION
SELECT NameField
FROM SecondTable
 
I know I'm not supposed to do this but I'm hoping Pbaldy (Paul) can help. Following on your advice I set up a union select query and it works fine. However, I cannot figure out how to sort my results from the query alphabetically. Here is what I posted on the queries thread for help but got no replies:

I have the following union select query:

SELECT Counselor
FROM Counselors
UNION SELECT StaffName
FROM tblOtherStaff
UNION SELECT CaseMgr
FROM tblCaseMgrs
UNION SELECT PsychName
FROM tblPsychs
UNION SELECT SocialWrkr
FROM tblSocWrkrs
UNION SELECT DeanName
FROM tblDeans;

These are all lists in the database that need to be maintained seperately, but which are used for list boxes as the responsible person on certain activities. Here is my problem... I've searched the database and can't figure out how to alphabetize this list for ease of use. To make matters worse, I'd like to sort on the last word in the various field names then the first word in the field names (i.e. last name then first name). They are not broken down into two fields at this point.
 
Oops... just got an answer on the Queries thread. I'll try that.
 

Users who are viewing this thread

Back
Top Bottom