You must create a new query that includes the fields referred to in the
RowSource property of the AutoLookup fields. Use this query as the data source for your Word Mail Merge document.
To display the AutoLookup values in a Word Mail Merge document, follow these steps.
CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.
Prepare for the Mail Merge
1. | Start Microsoft Access and open the sample database Northwind.mdb.
|
2. | In the Database window, click Tables under Objects, click the Orders table, and then click Design.
|
3. | Select the CustomerID field and, on the Lookup tab under Field Properties, examine the RowSource value. Note that AutoLookup uses the CustomerName field from the Customer table for its lookup value. This reference is used in step 10.
|
4. | Select the EmployeeID field and, on the Lookup tab under Field Properties, examine the RowSource value. Note that AutoLookup concatenates the LastName and FirstName field values from the Employees table for its lookup value.
These references are used in step 11.
|
5. | In the Database window, click the Queries tab, and then click New.
|
6. | In the New Query dialog box, select Design View, and then click OK.
|
7. | In the Show Table dialog box, select Employees, and then click Add.
|
8. | Repeat step 7 for the Orders table and the Customers table, and then click Close.
|
9. | From the Orders table, add all the fields except the CustomerID and EmployeeID fields to the query design grid.
|
10. | Add the CompanyName field from the Customers table to the query design grid.
|
11. | Add the LastName and FirstName fields from the Employees table to the
query design grid.
|
12. | Save the query as MergeOrders, and then close it.
|
Running the Mail Merge
1. | In the Database window, click Queries under Objects, and then select the MergeOrders query that you created in the
"Prepare for the Mail Merge" section.
|
2. | On the Tools menu, point to OfficeLinks, and then click Merge It with MS Word.
|
3. | In the Microsoft Word Mail Merge Wizard dialog box, click to select the Create a new document and then link the data to it check box, and then click OK.
Note that Microsoft Word starts and that a new, blank document is
created.
|
4. | On the Mail Merge toolbar in Word, click the Insert Merge Field button. Note the list featuring all the fields in the Orders table, the CompanyName field from the Company table, and the LastName and FirstName fields from the Employees table. Select CompanyName from the list, and then press ENTER.
|
5. | Click the Insert Merge Field button, select LastName from the list to add it to the document, and then press COMMA and then SPACEBAR to separate the LastName field from the FirstName field.
|
6. | Click the Insert Merge Field button, select FirstName from the list, and then press ENTER.
|
7. | On the Mail Merge toolbar, click the View Merged Data button.
Note that the data presented in the Mail Merge document is composed of the same AutoLookup field values that are displayed in the Orders table. |