If you need to send the same letter to people listed in two
different database tables, you don’t have to create two different mailing lists. You
can use Microsoft Access’s Union query to combine the two tables into one list.
For example, suppose you want to send the same letter to all
your company accounts and the interns working on those accounts. The Customer
database contains the name of each company in the Name field. The Intern
database contains the name of each Intern in two fields, Last Name and First Name.
You want the results of the Union query to combine the Name fields from both
databases into one MailingName field. The Intern
table’s MailingName field is a combination of the
Last Name and First Name fields and the Customer table’s MailingName
field comes from the Name field, renamed MailingName.
Follow these steps to create a mailing list from two
different tables:
- In the
Database window, click Queries under Objects and then click New. - Double-click
the Design View. - Click
Close. - Go to
Query | SQL Specific | Union. - Enter
the following code at the prompt:
SELECT [First Name] & " " & [Last Name] As [Mailing Name], [Address], [City],
[State], [Zip Code]
FROM Intern
UNION SELECT [Name] As [Mailing Name], [Address], [City], [State], [Zip
Code]
FROM Customer;
- Click
Run on the Query toolbar.
The Union query results contain both the interns’ and
companies’ names and addresses.
Help users increase productivity by automatically signing up for TechRepublic’s free Microsoft Office Suite newsletter, featuring Word, Excel, and Access tips, delivered each Wednesday.