View Single Post
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Jesse[_3_] Jesse[_3_] is offline
external usenet poster
 
Posts: 2
Default puzzling number format problem in conditional field

I am doing a Word mailmerge with an Access database -- Office 2000.
The problem has to do with currency fields in the database and getting
the \# formatting to work.

Based on what I see, Word has default formatting for currency numbers
- putting a dollar sign in front of them unless you tell Word
otherwise. I have been able to override this by using a format
switch. So:

{MERGEFIELD ttl_price \###.00}

However, when I add this switch to this mergefield within a
conditional statement -

{IF { MERGEFIELD country} = "United States", "{MERGEFIELD ttl_price
\###.00}" "" }

- the formatting code disappears when I switch to "View merged data"
and back - and so it has not effect.

A workaround has been to add the mergefield to zero, and then the
formatting will stick and work:

{ = {MERGEFIELD ttl_price} + 0 \# ##.00 }

However, this causes a troublesome blank space to appear before the
number.

Another workaround, which is the most puzzling to me (as to why it
works): I create {MERGEFIELD ttl_price \###.00} outside the IF
statement and then paste it inside the statement,. Even with this
approach, every mergefield that I want within the IF statement has to
be pasted in as a block; if I just past in 1 field after others are
there, the new 1 filed disappears.

Please note, all of the { } brackets are created by doing an insert -
i.e., not by typing the brackets. AFAIK, when adding a mergefield one
has to manually add in the formatting - i.e., there is no "insert
field switch format picture", so entering it by typing should work.

Also, in order to try to suppress Word adding a $, I did try changing
the field type in Access from currency to number, but then anything
right of the decimal was dropped.

Any ideas as to why there is a problem formatting within the IF
statement? Especially, why creating the code outside the IF statement
and then pasting it in works? Thanks. -- Jesse.