Solved

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

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access Report Expression 4 28
Linking Child/Parent fields between 2 subforms 15 32
Access Query: Text to Date 10 34
Item not found in this collection 5 35
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

696 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