ODBC connect problems with Access and Word

K

kdg138

We have a Access form that was built some time ago (2000). There is a button
that opens a word document (mail merge), but when the document is open the
link is lost. When we go through the motions to connect the database, it
shows only a partial list of the tables and queries, and not the one we need.
Now here's the big however... however, when the document is opened directly
through word, the connection to the original query is intact and works.

Here is the VB script code. Hopefully someone can help me decipher why the
link is lost through Access. Thanks.
___________________________________________________________________
Private Sub cmdMMLetters_Click()
On Error GoTo Err_cmdMMLetters_Click

'Save last selection before merging letters

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Dim appWord As Object, strdoc As String, iEndPos As Long
Set appWord = CreateObject("Word.Application")
appWord.Visible = True
' strdoc = "c\Program Files\Microsoft Office\Office\"
iEndPos = InStrRev(CurrentDb.Name, "\")
strdoc = Left$(CurrentDb.Name, iEndPos) & "CR Instructor Confirmation
mmltr.doc"
appWord.Documents.Open (strdoc)
Set appWord = Nothing

Exit_cmdMMLetters_Click:
Exit Sub

Err_cmdMMLetters_Click:
MsgBox Err.Description
Resume Exit_cmdMMLetters_Click

End Sub
_________________________________________________________________
 
Top