I have an ODBC connection to a database on another
server. In this database I have 2 fields for the
zip code (ZIP and ZIP4) and 1 for the country. The
IF statement would follow this logic: IF the country
field is blank, THEN don't print a bar code at all, ELSE
IF the ZIP4 field is blank, THEN create a barcode based
on just the ZIP, ELSE create a barcode based on
ZIP & ZIP4.
I was successful in creating the correct field data to
produce the bar code by routing the ODBC data through
Excel and doing the IF/THEN there, but it adds several
extra steps to the process and this process is run daily
and currently through 3 steps (Run, Merge, Print). If I
can create the IF within Word, it could stay a 3 step
process instead of the 8 - 10 I came up with by pushing it
through Excel.
Thanks,
Jackie
Doug Robbins - Word MVP - 01 Apr 2004 07:27 GMT
Hi Jackie,
I can get the following Word If....Then ....Else field to display the
relevant barcodes
{ BARCODE { IF { MERGEFIELD Zip4 } <> "" "{ MERGEFIELD "Zip" }-{ MERGEFIELD
"Zip4" }" "{ MERGEFIELD "Zip" }" }\u}
and also this (as long as there is a country)
{ BARCODE { IF { MERGEFIELD Country } <> "" { IF { MERGEFIELD Zip4 } <> ""
"{ MERGEFIELD "Zip" }-{ MERGEFIELD "Zip4" }" "{ MERGEFIELD "Zip" }" } ""}
\u}
But if there is no country, the latter displays
No Zip Code!
which I guess is technically correct, but is probably not what you want.

Signature
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
>I have an ODBC connection to a database on another
> server. In this database I have 2 fields for the
[quoted text clipped - 16 lines]
> Thanks,
> Jackie
Jackie Mulholland - 01 Apr 2004 15:12 GMT
Thank you,
That's exactly what I was looking for.
Jackie
>-----Original Message-----
>Hi Jackie,
[quoted text clipped - 39 lines]
>
>.