If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Restrict records that match date criteria at merge time
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? |
#2
|
|||
|
|||
Restrict records that match date criteria at merge time
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 :-) |
Thread Tools | |
Display Modes | |
|
|