Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mail Merge - Word (Access 2002)

    Hi

    I am trying to automate a mail merge in Access to a Word Document template. Having no experience in this area, I have been trying to use advice from previous posts, but have run into problems. So hopefully someone can assist me.

    As background the DB has a BE and FE. The information needed for the word template is pulled from 5 tables. The code I am current using is (I have only included relevant bits not the entire code):

    For x = 0 To ctl.ItemsSelected.Count - 1
    strselection = strselection & "Approval.ID = " & ctl.Column(0, ctl.ItemsSelected.Item(x)) & " Or "
    Next x

    strselection = Mid(strselection, 1, Len(strselection) - 3)

    Dim strsql As String

    strsql = "SELECT DISTINCTROW Company.Company_ID, Company.Company, Company.Address, IIf([Town]='' Or IsNull([Town]),[City],[Town]) AS TownCity, "
    strsql = strsql + "Company.City, Approval.Product, Codes.Code, productcode(Codes.code) AS Appcode, Codes.Code_Description, ProductDescription.ProductDescription, "
    strsql = strsql + "Approval.ApprovalDate, Password.SystemName, Password.Title, Password.BusinessGroup "
    strsql = strsql + "FROM ProductDescription INNER JOIN ([Password] INNER JOIN (Company INNER JOIN (Codes INNER JOIN Approval ON Codes.CODEID = Approval.Code_ID) "
    strsql = strsql + "ON Company.Company_ID = Approval.Company_ID) ON Password.PasswordID = Approval.Approver_ID) "
    strsql = strsql + "ON ProductDescription.ProductDescription_ID = Approval.ProductDescription_ID "
    strsql = strsql + "WHERE " + strselection +

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail Merge - Word (Access 2002)

    Maybe not the best solution but you can give it a try.
    Change your query in a Make Table query and use the new table as source for your mail merge.
    Francois

  3. #3
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail Merge - Word (Access 2002)

    Hi Francois

    Great idea, I will give it a go.

    Thanks

    WTH

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Mail Merge - Word (Access 2002)

    You might also find our Word Merge Tutorial and the Woody's Access Watch it references helpful background for what you are trying to do. We also have an Automation Tutorial that gives more general information.
    Wendell

  5. #5
    2 Star Lounger
    Join Date
    Sep 2001
    Location
    Wellington, Wellington, New Zealand
    Posts
    181
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Mail Merge - Word (Access 2002)

    Hi

    Thanks for the suggestion, although managed to get it going as per Francois suggestion.

    Regards
    WTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •