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 / May 2004

Tip: Looking for answers? Try searching our database.

Restrict records that match date criteria at merge time

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Wilde - 04 May 2004 13:46 GMT
Im trying to prepare a standard letter that uses fields
from a database via ODBC and Microsoft SQL.  At merge
time, what is the easiest way for the office secretaty to
restrict the output letters between two dates? Is it
possible to embed dialog boxes that would appear at merge
time?  Any suggestions?
Cindy M  -WordMVP- - 05 May 2004 08:40 GMT
Hi Peter,

> Im trying to prepare a standard letter that uses fields
> from a database via ODBC and Microsoft SQL.  At merge
> time, what is the easiest way for the office secretaty to
> restrict the output letters between two dates? Is it
> possible to embed dialog boxes that would appear at merge
> time?

Filtering using dates in mail merge is a tricky proposition;
the dialog box way, then adjusting the QueryString property,
is probably the "safest" way.

The basic approach I'd consider:

1. Use a macro named AutoNew (will execute when a new doc is
created from a template)

2. Have it display a UserForm (dialog box) with two text
boxes for the dates.

3. The code behind the "OK" button would check the dates for
validity (IsDate), then adapt the
ActiveDocument.MailMerge.DataSource.QueryString property.
Exactly how you want to do that will depend on whether it
previously has been modified in any way, or whether you can
write it from scratch, but the syntax is standard SQL for
the type of datasource you're using.

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.