Hi all,
First post. 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!