francdatabase
New member
- Local time
- Today, 09:34
- Joined
- Oct 22, 2008
- Messages
- 2
Hello all,
I hope this will be a quick one for someone who has done this before, but I am going round in circles!
I am trying to use a password-protected ACCDE as the data source for a Word MailMerge but keep getting the 'Error has occurred: Not a valid Password' pop-up. I have checked the password and it is correct. Here is the code I am trying with:
I hope this will be a quick one for someone who has done this before, but I am going round in circles!
I am trying to use a password-protected ACCDE as the data source for a Word MailMerge but keep getting the 'Error has occurred: Not a valid Password' pop-up. I have checked the password and it is correct. Here is the code I am trying with:
Code:
With theDoc.MailMerge
.OpenDataSource Name:=myDatabase, _
ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, Revert:=False, PasswordDocument:="myWord", _
Format:=wdOpenFormatAuto, Connection:="TABLE " & tableName, SQLStatement:= _
"SELECT * FROM [" & tableName & "]", SQLStatement1:=""
.Destination = wdSendToNewDocument
.Execute
End With