Solved

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

Posted on 2014-07-25
5
845 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

758 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

18 Experts available now in Live!

Get 1:1 Help Now