Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 932
  • Last Modified:

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

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
SteveL13
Asked:
SteveL13
  • 3
2 Solutions
 
Leo AlexanderCommented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
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
 
SteveL13Author Commented:
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
 
Leo AlexanderCommented:
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
 
Leo AlexanderCommented:
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now