Solved

Mail Merge displaying confirm Data Source Dialog

Posted on 2010-09-03
9
736 Views
Last Modified: 2013-11-28
Here's my code for mailmerge- Access 2000 and word 2000

strTestDrive = "Select ID,'MR. ' + Trim(FullName),Address1 as Address1,Address2,Trim(City + chr(44) + State) as CS,Zip FROM TestDrive"
  Set wrdapp = CreateObject("Word.Application")
  Set worddoc1 = wrdapp.Documents.Add(Template:=myTemplate1, NewTemplate:=False, DocumentType:=0)
    worddoc1.MailMerge.OpenDataSource Name:="\\folder\GROUP\\Lunch.mdb", _
     LinkToSource:=True, Connection:="TABLE TestDrive", SQLStatement:=strTestDrive
     worddoc1.MailMerge.Destination = wdSendToNewDocument
     worddoc1.MailMerge.Execute
     worddoc1.AttachedTemplate.Saved = True
    worddoc1.Close False

My question is the 'confirm data source dialog box appears as well as the question to select the Table. Is there a way to automate this without the annoying prompts. I expect users not to see those needless prompts.
0
Comment
Question by:zachvaldez
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 6

Expert Comment

by:YohanF
ID: 33598386
did you try by setting "docmd.SetWarnings False" before you start the code and "docmd.SetWarnings True" at the end of the code ? I'm not 100% sure whether this might work in this instance, but you could try.

The other option is to make the security features in word to be very open, because as far as I understand this is a security prompt from word rather than access. So if no security at word level this may work like a baby, BUT IT MAY open up other loopholes in terms of macro viruses etc etc...
0
 
LVL 13

Assisted Solution

by:lucas911
lucas911 earned 200 total points
ID: 33598811
change this line
LinkToSource:=True, Connection:="TABLE TestDrive", SQLStatement:=strTestDrive
to
LinkToSource:=True, Connection:="TABLE TestDrive", SQLStatement:=strTestDrive, subtype:=3
0
 

Author Comment

by:zachvaldez
ID: 33599216
Unfortunately,the set warning to false does not change it.
0
 

Author Comment

by:zachvaldez
ID: 33599234
subtype:=3>>> getting error named argument not found. im using word 2000 already
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 13

Expert Comment

by:lucas911
ID: 33599674
0
 

Author Comment

by:zachvaldez
ID: 33600124
good article but then the subtype  argument does not apply to my version of word
0
 
LVL 13

Accepted Solution

by:
lucas911 earned 200 total points
ID: 33600202
how bout this?

http://support.microsoft.com/kb/209976

i know there was an issue if it was ms access 2003 and ms word 2000.
0
 
LVL 16

Assisted Solution

by:Sheils
Sheils earned 50 total points
ID: 33600934
I have been using the "Super Easy Word Merge" from Albelt Kallal website for ages without any hassle. Give it a try:

http://www.members.shaw.ca/AlbertKallal/msaccess/msaccess.html

0
 
LVL 6

Expert Comment

by:YohanF
ID: 33609530
By the way this may not be the best way to do it, why dont you create a report from Access to do what you have to do and then open it up. It may not suit you, if so please ignore my comment.

I had a similar issue as well and I opted to creating a report and exporting to PDF (in 2007 that feature is build in, but not sure for your version - if not use a printer like BullZip PDF printer). This way my application was movable to any user without having to make sure all the word documents exists for them.

Have a think about!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now