Results 1 to 2 of 2
  1. #1
    Slant is offline Novice
    Windows XP Access 2003
    Join Date
    Jul 2010
    Posts
    2

    Command button starts Word doc, but strips it of it's merge capability

    Hi all,



    I posted this topic in a different location to begin with, only to later realize this is probably a better place for it. Thanks in advance for any help you can provide.

    In my Access app (Access 2003), I'm trying to add a command button that launches a specific Word document. Following is my code, which works fine:

    Dim LWordDoc As String
    Dim oApp As Object

    'Path to the word document
    LWordDoc = "my_path\my_doc.doc"

    Set oApp = CreateObject(Class:="Word.Application")
    oApp.Visible = True

    'Open the Document
    oApp.Documents.Open FileName:=LWordDoc

    End Sub

    When I press the command button the document launches as it should. However, this Word doc is a merge document, which draws data from a query that happens to be connected to this same Access app. When the Word doc launches I'm no longer presented with the "approve SQL data" dialog box. Instead, it just opens. The merge fields are still on the document, but it seems the connection to the query is no longer in place.

    Any ideas?

    Thanks!

  2. #2
    pkstormy's Avatar
    pkstormy is offline Access/SQL Server Expert
    Windows XP Access 2003
    Join Date
    Mar 2010
    Location
    Madison
    Posts
    682
    Duplicate post. See solution in other post.

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

Similar Threads

  1. Replies: 1
    Last Post: 08-01-2010, 12:06 PM
  2. Replies: 1
    Last Post: 07-27-2010, 02:27 PM
  3. Access / Word mail merge problem.
    By PD1117 in forum Access
    Replies: 0
    Last Post: 07-06-2010, 09:41 AM
  4. Command Button
    By lannoe in forum Forms
    Replies: 1
    Last Post: 07-01-2010, 01:48 PM
  5. Mail Merge from Access to Word
    By Rachelkm2 in forum Programming
    Replies: 1
    Last Post: 05-29-2009, 02:49 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