Solved

Somehow populate text data into a Word document via an Access form

Posted on 2014-07-25
5
905 Views
Last Modified: 2014-08-04
I have a form in Access that has two text fields.  I want to somehow populate the data in these fields into a Word document.  Can this be done and how?

--Steve
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 3

Expert Comment

by:Leo Alexander
ID: 40220614
THis can be done and canned scripts exist that work quite well for it.

Search for MS Access Mail Merge and this will provide exactly what you are looking for :)
0
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 250 total points
ID: 40220760
If you want to control this from the Access side, then you use OLE automation to control Word.   In your document template, you use bookmarks to mark the place where you want to put data,  then poke the data to the bookmarks.  

Attached is a sample DB which demonstrates this.

Jim.
mmA2002.zip
0
 

Author Comment

by:SteveL13
ID: 40225007
I have the Word doc created and the mail merge working.  I can launch the Word doc from a command button but it opens the merge to old data instead of new data.

The way I'm creating the data source is by running a delete table query and the running a make table query.  So the old data is deleted from the bound table and refreshed with new data.  

So why is the Word doc reflecting the old deleted data?

--Steve
0
 
LVL 3

Expert Comment

by:Leo Alexander
ID: 40225955
Steve,

Is your Word Doc fields connected to the datasource? Make sure that the Word Doc is not saving the information/embedding into the Doc itself. The fields within the Word Doc that are being generated need to have the Data Source behind them. i.e. {Name}, {Address},{City}, {State}, etc... should point to your back-end table.
0
 
LVL 3

Assisted Solution

by:Leo Alexander
Leo Alexander earned 250 total points
ID: 40225960
Take a look here at a very similar situation (toward the bottom) to get a working VBA sample:

http://www.experts-exchange.com/Programming/Microsoft_Development/Q_28093008.html
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question