Solved

Mail Merge displaying confirm Data Source Dialog

Posted on 2010-09-03
9
748 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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: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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

810 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