Results 1 to 3 of 3
  1. #1
    mafrank101 is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    12

    Need help with a mail merge with a parameter query

    I am trying to put a button on a form that will run a mail merge to populate a Word (2007) document with information from the single record in the form. I would think this would be easy to do, but after working on it, and searching the internet, I'm finding it is not. Normally I would simply use an Access Report to do this, but the document is about 7 pages long (a contract), and people want to have the ability to modify the result.

    What I have done so far:

    I've created a form that displays a single record from my Customers table
    I've created a query that pulls the Customer fields I need, and is filtered on the Customer ID that is active in the form. When I open this query by itself, it pulls back the one record I want.
    I then opened both the form and query, and then run through the External Data - Mail Merge wizard.

    Problems I've run into:
    1) Initially when I tried to select my query in the Mail Merge Wizard, it wouldn't show. I then found tips to prompt for the data connection type when the file is opened, and to set it to MS Access with DDE. This allowed me to see the query, and seemed to work OK when I added the fields I needed to the Word document. But then when I tried to rerun the Word doc, I would get a connection error. If I run through the connection setup process again, it seems to work, but again when I rerun it later, I get the connection error. For simplicity I have put the Access DB and Word document on my desktop. Eventually these will go on the network.

    At this point I have a button on my form, and it successfully opens the Word document, but the "merged" fields just show the record that I had saved the document with, so there is no true merging going on. If I open the Access DB Form & query and then open the Word document directly, I get the error "Word could not re-establish a DDE connection to Microsoft Access to complete the current task".

    I would think there has to be some standard method of doing this easily, as they are both Microsoft products, but I can't find it.



    Thanks

    Michael

  2. #2
    Stingaway is offline Efficiency Junkie
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2011
    Location
    The deep south. Keep going until you hit water basically.
    Posts
    224
    Any chance you could put the 7 page contract in as a report and then run it internally in Access? That way you could replace parts of your report with the field names (which would allow you the Parameter selection)..

    Other thought is that you could export your data to an excel spreadsheet first, and set up a button to run the mail merge based off the static data. (All of that could be push button, but you could test each step out along the way...)

  3. #3
    mafrank101 is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2010
    Posts
    12
    Thanks for your response. When we're tried putting the contract in Access as a report, we've run into issues such as the 22 inch limit, and formatting around blocks of text (some fields are large). The folks that oversee the contracts would rather have them in Word, so they're easier for them to edit.

    I guess I'm surprised there isn't an easy way to do this, I would think it is something quite common. We had an employee who set one up using a page and a half of VBA code, and it seems to work properly, but I was hoping there was an easier way.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 04-03-2012, 12:33 PM
  2. Mail Merge from Access Query
    By Baldeagle in forum Reports
    Replies: 5
    Last Post: 03-17-2012, 06:43 PM
  3. Button on form needed to run mail merge from query
    By nic79uk in forum Programming
    Replies: 1
    Last Post: 02-17-2012, 07:34 AM
  4. Using a pass-through query in mail merge
    By ss1289 in forum Access
    Replies: 0
    Last Post: 09-17-2010, 08:58 AM
  5. Access Query mail merge to Word
    By Jan Collier in forum Access
    Replies: 8
    Last Post: 08-30-2010, 09:52 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums