Microsoft KB Archive/211190

= HOW TO: Use Access 2000 Data in Word 2000 =

Article ID: 211190

Article Last Modified on 11/22/2002

-

APPLIES TO


 * Microsoft Word 2000 Standard Edition

-



This article was previously published under Q211190



IN THIS TASK
SUMMARY How to Use an Access Query or Table as a Word Data Source How to Use Microsoft Query to Retrieve Access Data as a Data Source in Word How to Export and Use Your Data from Access as a Word Data Source How to Copy, Paste, and Use Access Data as a Word Data Source
 * Method 1: Save Data as a Table
 * Method 2: Save Data in Tab-Delimited Format

REFERENCES



SUMMARY
This article explains how to do the following:
 * Use a Microsoft Access query or table as a Microsoft Word 2000 data source.
 * Use Microsoft Query to retrieve Access data as a data source in Word.
 * Export and use your data from Access as a Word data source.
 * Copy, paste, and use Access data as a Word data source.

back to the top

How to Use an Access Query or Table as a Word Data Source
For additional information about how to use an Access parameter query, click the article number below to view the article in the Microsoft Knowledge Base:

214183 WD2000: How to Use Mail Merge with an Access Parameter Query

To use an Access query or table as a Word data source, follow these steps:  If you want to use the results of an Access query or table as your data source in a Word mail merge, follow these steps:  On the Tools menu, click Mail Merge. In the Mail Merge Helper dialog box, click Get Data, and then click Open Data Source. Proceed to step 3.  If you want to insert the results of an Access query or table in a Word document, follow these steps:  On the View menu, point to Toolbars, and then click Database.</li> On the Database toolbar, click Insert Database.</li> In the Database dialog box, click Get Data.</li></ol> </li> In the Files of type list in the Open Data Source dialog box, click MS Access Databases.</li> Select the Access database file that you want to use as a data source.</li> Select the Select Method check box, and then click Open.</li> In the Confirm Data Source dialog box, click MS Access Databases via DDE (*.mdb;*.mde), and then click OK.

NOTE: If MS Access Databases via DDE (*.mdb;*mde) is not available, you need to remove and then reinstall Access.</li> In the Microsoft Access dialog box, click the Queries tab or the Tables tab.</li> Select the query or table that you want to use, and then click OK.

NOTE: On the Queries tab, the Link to Query check box is selected by default. This option creates a link to the Access database query. Select this check box to always retrieve the most up-to-date version of any of the listed queries. To ignore changes to the original query instructions, clear the Link to Query check box.</li> Word returns the results of your Access query or table to your Word document. Do one of the following, depending on whether you are performing a mail merge or just inserting a database:  If you are using the Mail Merge feature, Word prompts you with the following message:

Word found no merge fields in your main document. Choose the Edit Main Document button to insert merge fields into your main document.

Click Edit Main Document to insert merge fields into your main document.</li> If you are inserting database information, click Insert Data in the Database dialog box. In the Insert Data dialog box, either click All to insert all of the results of the Access query into your Word document, or click From, and then specify the records that you want to insert into your Word document.

NOTE: In the Insert Data dialog box, the Insert data as field check box is not selected by default. If selected, this option inserts the data into the table as a field. Select this check box if you want to update the data in your Word document whenever the data source changes.</li></ol> </li></ol>

back to the top

How to Use Microsoft Query to Retrieve Access Data as a Data Source in Word
To use Microsoft Query to retrieve Access data as a data source in Word, follow these steps:  If you want to use the results of an Access query or table as your data source in a Word mail merge, follow these steps:  <li>On the Tools menu, click Mail Merge.</li> <li>In the Mail Merge Helper, click Get Data, and then click Open Data Source.</li> <li>Proceed to step 3.</li></ol> </li> <li>If you want to insert the results of an Access query or table in a Word document, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>On the View menu, point to Toolbars, and then click Database.</li> <li>On the Database toolbar, click Insert Database.</li> <li>In the Database dialog box, click Get Data.</li></ol> </li> <li>In the Open Data Source dialog box, click MS Query.</li> <li>In the Choose Data Source dialog box on the Databases tab, click MS Access Database, and then click OK.

NOTE: The Use the Query Wizard to create/edit queries check box is selected by default. This option uses the Query Wizard to step you through the process of building a simple query that returns data to Microsoft Excel or another parent program. This is the procedure described here. Clear the Use the Query Wizard to create/edit queries check box to use Microsoft Query without the Query Wizard.</li> <li>In the Select Database dialog box, click the Access database file that you want to use, and then click OK.

NOTE: If you select the Read Only check box, you can read the file but cannot make changes to it. If you select the Exclusive check box, the database file is locked during the time that Word is using the Access database.</li> <li>In the Available tables and columns list in the Query Wizard - Choose Columns dialog box, make the selections that you want to use for your query, add them to the Columns in your query list, and then click Next.</li> <li>In the Query Wizard - Filter Data dialog box, filter the data to specify which rows to include in your query. If you do not want to filter the data, click Next.</li> <li>In the Query Wizard - Sort Order dialog box, specify how you want your data sorted. If you do not want to sort your data, click Next.</li> <li>In the Query Wizard - Finish dialog box, do one of the following: <ul> <li>Click Save Query to run the query, and then add this query to the list of available queries. Use this list when you choose a query to run from Excel or Microsoft Query or when you choose a data source. When you click Save Query, the query's design is saved as the following file type:

*.dqy

-or-</li> <li>Click Return Data to Microsoft Word, and then click Finish to run the query and return the query results to Word.

-or-</li> <li>Click View data or edit query in Microsoft Query, and then click Finish to run the query and return the query results to Microsoft Query. You can view the data and make additional changes to your query in Microsoft Query before you return the data to Word.</li></ul> </li></ol>

NOTE: When you try to use Access as a data source in Microsoft Query, you may receive the following error message:

Word was unable to open the data source.

This behavior may occur when you use an Access query or table.

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:

224056 WD2000: Error Message: Word Was Unable to Open the Data Source

back to the top

How to Export and Use Your Data from Access as a Word Data Source
To export and use your data from Access as a Word data source, follow these steps: <ol> <li>In Access, open your database table or query.</li> <li>On the File menu, click Export.</li> <li>In the Export Table or Export Query dialog box, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>In the Save as type list, click Microsoft Word Merge.</li> <li>In the File name box, type a name for the exported file.</li> <li>In the Save in list, select the folder in which to save the file.</li></ol> </li> <li>Click Save All.

Access now exports your table or query result as a tab-delimited text file.</li> <li>Close your database, and then quit Access.</li></ol>

In Word, use the exported tab-delimited text file to continue your Word mail merge or to insert the database file as usual.

back to the top

How to Copy, Paste, and Use Access Data as a Word Data Source
To copy, paste, and use Access data as a Word data source, follow these steps:
 * 1) Open your Access database table or query.
 * 2) On the Edit menu, click Select All Records.
 * 3) On the Edit menu, click Copy.
 * 4) Open a new, blank document in Microsoft Word.
 * 5) Use one of the following methods.

back to the top

Method 1: Save Data as a Table

 * 1) On the Edit menu, click Paste Special. In the Paste Special dialog box, click Formatted Text (RTF) under As.

The information from your Access table or query is pasted into a Word table.
 * 1) Save this new file as a Word document.

This new file is your new Word data source.

back to the top

Method 2: Save Data in Tab-Delimited Format
<ol> <li>On the Edit menu, click Paste Special.</li> <li>In the Paste Special dialog box, click Unformatted Text, and then click OK.

The information from your Access table or query is pasted into your Word document as tab-delimited text.</li> <li>On the File menu, click Save As.</li> <li>In the Save As dialog box, click Text Only in the Save as type box.</li> <li>In the File name box, type a name for your exported file.</li> <li>In the Save in list, select the folder in which to save the file, and then click Save. Click Yes in response to the following message

may contain features that are not compatible with Text Only format. Do you want to save the document in this format?

To save, click Yes.

To preserve formatting, click No. Then save a copy in the latest Word format.

where  is the name of your Word document that contains the text from Access.</li> <li>Close your Word data source document, and then continue your Word mail merge, or insert your database file as usual.</li></ol>

back to the top

<div class="references_section">