Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Mail Merge displaying confirm Data Source Dialog

Posted on 2010-09-03
9
Medium Priority
?
809 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:Lucas
Lucas earned 800 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:zachvaldez
ID: 33599234
subtype:=3>>> getting error named argument not found. im using word 2000 already
0
 
LVL 13

Expert Comment

by:Lucas
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:
Lucas earned 800 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 200 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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

972 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