Merge Rule not functioning

P

purpleman

My weekly mail-merge Access database has a field named 'LetterSent' which I
insert the date into after merging.
I add a hundred or so names to the db each week and want to use the Merge
Rule: Skip Record If Field LetterSent Is Not Blank.

But it won't work. It is trying to send to all of the records.
Any clues as to why?
 
P

Peter Jamieson

Are you
a. defining this rule using the Mail Merge Recipients dialog box (or
e.g. the "Query Options" dialog box, or
b. inserting a SKIPIF field into the document that does something like

{ SKIPIF { MERGEFIELD LetterSent } <> "" }
?

Either way, if you insert LetterSent as a Merge field, what value is
actually inserted if you have not yet assigned a date in Access? Your
rule may need to match something other than blank for this to work.

Peter Jamieson

http://tips.pjmsn.me.uk
 
P

purpleman

Thanks for the response PJ.
Maybe I have missed a step in the process.
I simply selected from the Rules sub-menu:
SKIP RECORD IF FIELD LETTERSENT IS NOT BLANK
The field LetterSent is there to be selected. Not sure what should be in the
Compare To box.
If I insert the LetterSent field into the Word doc, the actual date sent
appears for records that have a date sent. Else nothing appears. That is how
it should be.
But if I insert the SKIP RECORD IF Rule above, it still prints the letter
whether there is a date in the field or not.
Am I supposed to insert a field for LetterSent into the Word doc? Seems odd
to do so.
 
P

Peter Jamieson

I simply selected from the Rules sub-menu:
SKIP RECORD IF FIELD LETTERSENT IS NOT BLANK

OK, that menu would insert a nested SKIPIF field like this:

{ SKIPIF { MERGEFIELD LETTERSENT }<> "" }

and that should work, as long as you only use one data source record for
each letter that you produce. But
a. maybe you can have a look at your mail merge main document, press
Alt-F9 and see if that nested field is there. If it is, can you check
that it is exactly as above (spaces may be significant) and that {
MERGEFIELD LETTERSENT | is actually completely blank, i.e. does not
insert anything, not even a space.
b. As an alternative, you could try using Edit Recipient List to
define the filter instead, but I think you will probably see the same
result.
Am I supposed to insert a field for LetterSent into the Word doc?

No, it was just an experiment to see what Word "thinks" Lettersent contains.

Peter Jamieson
http://tips.pjmsn.me.uk
 
P

purpleman

Excellent. It's working.
Don't know what I did wrong before but Alt F9 helps massivley.
Thank you PJ. Very helpful.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top