Mail Merge - DB Admin Locked Error

S

Sarah

Hi folks. I am using this code to open a mail merge
Function MergeIt()

Dim objWord As Word.Document
Set objWord = GetObject("Shared\Russ Reid1\TYLetters\2009 Form
Letter.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the Northwind database.
objWord.MailMerge.OpenDataSource _
Name:="\\Firebox\shared\Development\Data\Contact Database\NAME.mdb", _
LinkToSource:=True, _
Connection:="Query qrymailmergefinal", _
SQLStatement:="SELECT * FROM [qrymailmergefinal]"
' Execute the mail merge.
DoCmd.CloseDatabase
objWord.MailMerge.Execute
End Function

and it appears to work fine except I get a db locked error. Any thoughts?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top