N
Newbie
Hi,
Access 2002
I have a letter in Word that I want to print from Access based on a query
for the recipients but I get the following error:
Run Time error 5922
Word was unable to open the data source
What am I doing wrong?
Here is my code:
Dim strEmp As String
strEmp = "001"
Set objWord = GetObject("C:\ProjectGoWest\RedLetter1.doc",
"Word.Document")
objWord.Application.Visible = True
objWord.MailMerge.OpenDataSource _
Name:="C:\ProjectGoWest\GoWest.mdb", _
LinkToSource:=True, _
Connection:="QUERY Works", _
SQLStatement:="SELECT * FROM Works WHERE Recip = '" & strEmp & "'"
objWord.MailMerge.Execute
Thanks
Access 2002
I have a letter in Word that I want to print from Access based on a query
for the recipients but I get the following error:
Run Time error 5922
Word was unable to open the data source
What am I doing wrong?
Here is my code:
Dim strEmp As String
strEmp = "001"
Set objWord = GetObject("C:\ProjectGoWest\RedLetter1.doc",
"Word.Document")
objWord.Application.Visible = True
objWord.MailMerge.OpenDataSource _
Name:="C:\ProjectGoWest\GoWest.mdb", _
LinkToSource:=True, _
Connection:="QUERY Works", _
SQLStatement:="SELECT * FROM Works WHERE Recip = '" & strEmp & "'"
objWord.MailMerge.Execute
Thanks