Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / April 2004

Tip: Looking for answers? Try searching our database.

Mail Merge Disable Choose Data Source

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mariatherp - 22 Apr 2004 20:01 GMT
Hi There,

I have set up a merge filter. If there is no data meeting the criteria
the users will receive this message:

"Word could not merge the main document with the data source because
the data records were empty or no data records matched your query
options." At this point I would like a msg box to come up "goodbye" and
close word. But Word allows the user to choose a new data source.  

Can anyone help me with a solution?

Thanks,

Maria
Cindy M  -WordMVP- - 24 Apr 2004 10:08 GMT
Hi Mariatherp,

> I have set up a merge filter. If there is no data meeting the criteria
> the users will receive this message:
[quoted text clipped - 3 lines]
> options." At this point I would like a msg box to come up "goodbye" and
> close word. But Word allows the user to choose a new data source.

You'd have to handle all of this through a macro (VBA). Once you have the
merge filter defined in SQL syntax, don't send it to Word's .QueryString
property immediately.

Instead, use ADO or DAO to connect to the same data source, using this
SQL. Check the number of records in the recordset, and if it's 0, display
the message you wish. If it's >0, go ahead and do the Word stuff.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.