I am trying to merge certain fields from a table in Access to a Word doc, but I am recieving an error: "Word cannot open the data source". Here is the code that it is bombing on.
ObjWord.mailmerge.OpenDataSource _
Name:=lvQISName, _
LinkToSource:=True, _
Connection:="TABLE tblBPAMerge", _
SQLStatement:="Select * from [tblBPAMerge] WHERE Initials='" _
& [Forms]![frmMainMenu]![txtInitials] & "'"
When I put a stop in the code, the dialog boxes pop up and one gives a choice of Datasources. It seems that when it chooses the datasource as OLE DB it bombs, but if MS Access databases via DDE is chosen it works fine?? Help. The user will not see these dialog boxes and will not have the choic.
ObjWord.mailmerge.OpenDataSource _
Name:=lvQISName, _
LinkToSource:=True, _
Connection:="TABLE tblBPAMerge", _
SQLStatement:="Select * from [tblBPAMerge] WHERE Initials='" _
& [Forms]![frmMainMenu]![txtInitials] & "'"
When I put a stop in the code, the dialog boxes pop up and one gives a choice of Datasources. It seems that when it chooses the datasource as OLE DB it bombs, but if MS Access databases via DDE is chosen it works fine?? Help. The user will not see these dialog boxes and will not have the choic.