Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22
  1. #16
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Sorry, I give up on your db.

    I downloaded sample db from http://www.access-programmers.co.uk/...d.php?t=211933 see post #9 - in spite of what post says, the db is an mdb.


    This example uses 3 files:
    Access database
    Word document
    a text file of field names

    It works. Follow instructions in the db to change file path in the code. Maybe you can adapt the working example to your db.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  2. #17
    bellevue is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    Apr 2012
    Posts
    61
    Thanks June7

    I've had a look at this and it seems ideal; however, I'm struggling to work out how to change the code to read the data source which is a query ("MasterDataSource")...can you help please ?

  3. #18
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    So if you don't want to use a form's RecordSource as data source, call the MergeAllWord function with:

    MergeAllWord ("SELECT * FROM MasterDataSource")
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #19
    bellevue is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    Apr 2012
    Posts
    61
    Thanks ever so June7

    Sorry to be thick but where would I put that code, would it replace something else and would I need to take some code out ?

    Thanks

  5. #20
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    Open the VBA editor. In the Form_Contacts module go to Sub cmdMergeAll_Click. That procedure calls a function called GoMergeAll. That function calls the MergeAllWord function. Change the GoMergeAll function code as shown in my previous post.

    Or can just put call to MergeAllWord directly in the Click event in place of GoMergeAll.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #21
    bellevue is offline Advanced Beginner
    Windows XP Access 2000
    Join Date
    Apr 2012
    Posts
    61
    Hello June7

    Thanks for that; I should be able to work that out.

    However, I've found a better option, still from Albert Kallal, and this version, the Super Easy Word Merge (http://www.kallal.ca/msaccess/msaccess.html - it's about half way down the page) doesn't open up another database to perform the merge.

    On top of that, you can place one command button on a form and when you click it, it opens a menu of templates to use which is much better for me as I'll eventually have quite a few templates to use.

    The problems I have is how to amend what code to ensure it works with a query as the data source and also how to get it work on my form, which I think is a subform, (you open the form "Reservations" by pressing a command button on "Customers").

    Sorry to be asking again but do you know what I need to do please ?

    Thanks

  7. #22
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    I can't work with db files until after Feb 22. If you still need help then, let me know with another post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Mail Merge
    By sakhtar in forum Access
    Replies: 8
    Last Post: 09-20-2020, 09:10 AM
  2. Mail Merge
    By DCV0204 in forum Forms
    Replies: 6
    Last Post: 12-13-2011, 09:32 AM
  3. Mail merge with word
    By alexc333 in forum Access
    Replies: 0
    Last Post: 07-26-2011, 12:06 PM
  4. Mail Merge
    By Nixx1401 in forum Access
    Replies: 1
    Last Post: 02-15-2010, 10:51 AM
  5. Mail merge
    By grgerhard in forum Forms
    Replies: 0
    Last Post: 04-25-2006, 05:06 PM

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