Others

How to Pass Access Text Fields to Word with VBA or Mail Merge

Nimra MalikNimra Malik Nov 3, 2026 868 views

Question details

The user needs to insert database records from Microsoft Access into an editable Word document for document generation.

How to Pass Access Text Fields to Word with VBA or Mail Merge
Product
Microsoft Access and Microsoft Word
Device & OS
not provided
Scenario
Automating the creation of documents by transferring text fields from an Access database to a Word template.
Observed behavior
Users seek the correct methods to push data to Word but often encounter missing library references, incorrect template paths, or connection errors when running VBA scripts.
Before you start

Ensure that your target Word template (.dotx or .docx) is saved in an accessible local directory, and note down the exact file path before beginning the setup.

Solution 1Recommended

Use Access Mail Merge for Standard Document Generation

The built-in Mail Merge feature is the easiest and most reliable method for generating standard documents without writing code.

This method utilizes the native connection between Microsoft Access and Word, allowing you to quickly merge database queries into pre-formatted text documents.

1
Select Your Data Source

Open your Microsoft Access database. In the Navigation Pane, click to select the table or query that contains the text fields you want to pass to Word.

2
Initiate Mail Merge

Navigate to the 'External Data' tab on the Access ribbon. In the 'Export' group, click on the 'Word Merge' button.

3
Follow the Wizard

In the Microsoft Word Mail Merge Wizard dialog box, choose whether to link your data to an existing Word document or create a new one, then click OK.

4
Insert Merge Fields

Microsoft Word will open. Use the 'Mailings' tab in Word to click 'Insert Merge Field' and place your Access text fields into the document layout.

Use Access Mail Merge for Standard Document Generation
Automatic Updates: Using this native feature ensures that your Word document maintains an active link to the Access database for easy future updates.
Free Microsoft Office alternative

Try WPS Office for Seamless Document Management

While Microsoft Access and Word VBA are highly specialized setups, WPS Office provides a free, lightweight, and highly compatible alternative for everyday document generation, mail merges, and data management. Enjoy a familiar interface that handles complex documents and spreadsheets effortlessly without expensive subscriptions.

Free and lightweight office suite for Windows, Mac, and Linux.High compatibility with Microsoft Word (.docx) and Excel (.xlsx) formats.Built-in Mail Merge features using spreadsheets as data sources.Familiar user interface for a zero-learning-curve transition.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my VBA code fail to create the Word document?

This typically occurs if the file path provided for the Word template is incorrect or if the Microsoft ActiveX Data Objects Library reference is not enabled in the VBA Editor's Tools > References menu.

Can I format the text fields when passing them from Access to Word?

Yes. When using Mail Merge, you can apply formatting directly to the merge fields within the Word template. If using VBA, you can format the text by manipulating the properties of the Word Range object (e.g., objDoc.Range.Font.Bold = True) after inserting the text.

How do I loop through multiple records in VBA effectively?

You can loop through multiple records by using a 'While Not rs.EOF' structure in your VBA script. Ensure you include 'rs.MoveNext' before the 'Wend' or 'Loop' statement; otherwise, your script will get stuck on the first record in an infinite loop.