In a query, use the
Format() function in an expression to create a text string of formatted data from the field. You can then base the mail merge on that query and see the formatting. To send formatting to Word through mail merge, follow these steps:
- Open the sample database Northwind.mdb.
- Create the following query:
Query: MyTest1
-----------------------------------------
Type: Select Query
Field: OrderId
Table: Order Details
Criteria: 10252
Field: UnitPrice
Table: Order Details
Field: Discount1: Format([Discount],"0%")
Note that the last field cannot be called Discount because it would
cause a circular reference with the original field name.
- On the Query menu, click Run. Note that the Discount1 column shows a percent (%) symbol next to each discount.
- On the File menu, click Save. Type MyTest1 in the Query Name box, and then click OK.
- On the File menu, click Close.
- Select the MyTest1 query in the Database window, but do not open it.
- On the Tools menu, point to Office Links, and then click Merge It With MS Word.
- In the Microsoft Mail Merge Wizard dialog box, click to select
Create a new document and then link the data to it, and then click OK.
Note that Microsoft Word starts and that a new, blank document is
created.
- In Word, click Insert Merge Field. Note that a list of the fields in the MyTest1 query are displayed. Select OrderID, and then press ENTER.
- Click Insert Merge Field, and then select UnitPrice. Press ENTER.
- Click Insert Merge Field, and then select Discount1. Press ENTER.
- Click View Merged Data.
Note that the Discount1 field has a percent sign (%) for all the records.
Because the expression in the query evaluates to a text string, the percent
sign is not lost.