Solved

Mail Merge displaying confirm Data Source Dialog

Posted on 2010-09-03
9
742 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
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…

863 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

20 Experts available now in Live!

Get 1:1 Help Now