Solved

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

Posted on 2014-07-25
5
865 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
  • 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 57

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

910 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now