Re: mail merge selection criteria
- From: Cindy M. <C.Meister-C@xxxxxxxxxx>
- Date: Tue, 21 Nov 2006 20:45:22 +0100
Hi Barry,
OK, let me be sure I understand you correctly. You're in the "Filter and Sort"
dialog box (where there are multiple lines) and you set
pletter | equal to | y
and
email | is blank |
Word then adds an additional line:
or
email | is blank
FWIW, when I test this (different field names, but same type of criteria) I see
the same with Word 2003 (IE6). What's more, it happens again and again each time
I display the dialog box. So I'm guessing this may be some other update than
IE...
If I use macro code, things appear to work correctly, although the "Filter and
Sort" doesn't show the filter I've set. For example:
Sub SetMergeFilter()
Dim SQl As String
Dim TableName As String
Dim Crit1 As String, Crit2 As String
TableName = "[Office Address List]"
Crit1 = "[First Name] = 'Cindy'"
Crit2 = "[Last Name] IS NULL"
SQl = "SELECT * FROM " & TableName & " WHERE " & Crit1 & " AND " & Crit2
ActiveDocument.MailMerge.DataSource.QueryString = SQl
End Sub
You'd basically only need to substitute the information for TableName, Crit1 and
Crit2. You could even build a form to enter this. But if you can find a
combination in "Filter and Sort" that works reliably, you may prefer that...
Among the fields are two that I am sorting on. One is "pletter" and the
other "email". Out of a list of around 500 entries I am selecting people who
have asked for a periodic letter and who do not have email (I use a group
mailing in Outlook for those on email). So the select criteria is "pletter
equal to y" and "email is blank".
Whichever way round I set that it puts adds "or email is blank". If the
"and pletter is equal to y" then follows it is OK. If I select in the other
order the "or email is blank" then selects all the entries where that
criteria is matched, and this includes many more than I want.
I did find that "contains y" provided a better control.
I am rather busy now so I will have to run some tests tomorrow and vary the
criteria to see what happens. However, the automatic additional "or email is
blank" should not happen.
My upgrade was IE7 and it messed up at least two other applications so I
uninstalled it and am back to IE6 with those programmes now working. I am
unable to be sure that the upgrade to IE7 was the cause; I had not noticed it
before.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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 :-)
.
- References:
- Re: mail merge selection criteria
- From: Cindy M .
- Re: mail merge selection criteria
- From: Barry Osborne
- Re: mail merge selection criteria
- Prev by Date: Re: How I set up a form so I input information using data form ico
- Next by Date: Re: Object error
- Previous by thread: Re: mail merge selection criteria
- Next by thread: Re: Template fields not useable in new doc created from template.dot
- Index(es):
Relevant Pages
|