I am using Word mailmerge to print fields calculated in Access. I want a
null or zero result to print as blank. Should be simple but ... !!
Use a conditional field
{IF{Mergefield fieldname} <> 0 "{Mergefield Fieldname}"}
See also http://www.gmayor.com/formatting_word_fields.htm

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> I am using Word mailmerge to print fields calculated in Access. I
> want a null or zero result to print as blank. Should be simple but
> ... !!
Nasscott - 07 May 2006 17:50 GMT
Thanks Graham - the conditional construct was beyond me but I found the
answer on your website - amazing what a couple of semicolons can do !
> Use a conditional field
> {IF{Mergefield fieldname} <> 0 "{Mergefield Fieldname}"}
[quoted text clipped - 3 lines]
> > want a null or zero result to print as blank. Should be simple but
> > ... !!
Hi Nasscott,
To fix this:
. press Alt-F9 in your mailmerge document to toggle the field code display
on. You should see something like:
{Mergefield DataField} or {Mergefield DataField \# 0.00}
.edit the field code so that it formats the result how you want it. For
example:
{Mergefield DataField \# $,0.00;($,0.00);}
will show the value as dollars and cents, with -ve values in brackets, and
the final ';' suppresses 0 output.
If you're working with what is meant to be purely textual data, formatting
the field as {Mergefield DataField \# ;} will likewise suppress any 0s
(along with any other mixed alpha-numeric output).
If you need to show mixed alpha-numeric output, but suppress errant 0s, try:
{IF{Mergefield DataField}= 0 "" {Mergefield DataField}}
to do this, you'll need to:
. copy & paste your mergefield, so that you get
{Mergefield DataField} {Mergefield DataField}
.select both mergefields and press Ctrl-F9 (to wrap them in another field,
thus-
{{Mergefield DataField} {Mergefield DataField}}
. fill in around the field braces as indicated, taking special care with
spacing.
Cheers
> I am using Word mailmerge to print fields calculated in Access. I want a
> null or zero result to print as blank. Should be simple but ... !!
tamee - 19 Mar 2007 14:54 GMT
This is very useful to me. But how do you convert date serial number from
excel to a particular date format in a merge field?
> Hi Nasscott,
>
[quoted text clipped - 27 lines]
> > I am using Word mailmerge to print fields calculated in Access. I want a
> > null or zero result to print as blank. Should be simple but ... !!