View Full Version : Control to pull from two tables.


skelley
01-02-2001, 12:51 PM
How can I make a control (i.e. [ShipTo]]) have the user be able to select from two separate tables (i.e. tblCustomers and tblVendors)???

chrismcbride
01-03-2001, 08:59 AM
Skelly
What you want is a Union Query. If you have two or more tables with matching field names, you can set the rowsource of a combo box to a Union Query String. Following is an example from one of my apps...

SELECT id_string & ID, id_string FROM tblRequest UNION SELECT id_string & ID, id_string FROM tblExcursion UNION SELECT id_string & ID, id_string FROM tblRandD UNION SELECT id_string & ID, id_string FROM tblUnrelated ORDER BY id_string;

Hope this helps...
Chris