Error 5922

I have a mailmerge between access and word  bu I am getting error 5922 ' word cannot open datasource. I m usig office 2010 and I don;t lnow if odbc drivers had to be installled.
here's the connection..

 Set wrdapp = CreateObject("Word.Application")
    Set worddoc = wrdapp.Documents.Add(Template:=myTemplate, NewTemplate:=False, DocumentType:=0)
   
     worddoc.MailMerge.OpenDataSource Name:="C:\Event\Boat.accdb", LinkToSource:=True,TABLE [tblBoat],SQLStatement=strsql
zachvaldezAsked:
Who is Participating?
 
Jeffrey CoachmanConnect With a Mentor MIS LiasonCommented:
There are lots of links here demonstrating how to Mail Merge from MS Access
http://www.google.com/search?q=site%3Awww.experts-exchange.com+mail+merge+from+Ms+Access

But keep this Q open for a few days more in case another expert has a more targeted solution.
0
 
Jeffrey CoachmanMIS LiasonCommented:
To do a normal Mail merge in Word with an Access table/query as the source requires no code.

If you do this manually, does it work?
0
 
zachvaldezAuthor Commented:
yes
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
zachvaldezAuthor Commented:
I'd like to place it in a button clivk
0
 
zachvaldezAuthor Commented:
Thanks!
 I did not have a problem since my PC got upgraded to Win 7 . My merge work well.
Now I created a new word template (dotx) with compatibility to previous version(2003). Since then Im getting 5922 error. My datasource change from Boat .mdb to Boat .accdb.

I m thinking of exporting the resultset to Excel 2010. It might work better than Access.
0
 
Jeffrey CoachmanMIS LiasonCommented:
"Now I created a new word template (dotx) ,"

Why not try using the original file first?
0
 
zachvaldezAuthor Commented:
U mean the .dot. Well I did that and I still get 5922
0
 
Jeffrey CoachmanMIS LiasonCommented:
OK.

Check the links I posted, and see if any of them are applicable.

In the mean time, we can wait and see if any other Experts chime in.
0
 
zachvaldezAuthor Commented:
I check the links but litle work in access 2010 has been done to address my question.
Thanks, the links would be useful references definitely if I encounter situations that may apply and I can always go back to this quesiton to find the hundreds of links.
Cause this is pressing, I end up doing the following
Run the query and stored it in excel file  for excample

strsql= "Select * INTO from table"
then I did
Docmd.Transfer... and save it to excel file

then I went and made the excel file as the datasource in the mail merged...

All I added was to the sub type at the end ..wdsubtype2000 something to avoid any annoying visual steps..

It could not  better.  This way if programming woun't work, the mai merged can still be built manually using the save Excel file..
0
 
Jeffrey CoachmanMIS LiasonCommented:
OK
0
All Courses

From novice to tech pro — start learning today.