Zero Values

S

Sue

How to I "hide" zero values in form fields? I want the users to have the
option to print a blank form without "0" displaying in the calculation fields.

Thanks!
 
T

Tony Jollans

You can use number formatting pictures, but .. don't do it through the
dialog.

In the Form Field Options Dialog for the field, make sure Text Format is
empty - and close the dialog

Press Alt+F9 to see the field codes in the document.
The calculated field will look something like this:

{ FORMTEXT { =Firstnum+Secondnum } }

where the bit inside the internal field is your calculation.
Add "\# #" after the calculation but before the closing brace so it looks
like ...

{ FORMTEXT { =Firstnum+Secondnum \# #} }

Press Alt+F9 to hide the field codes and it should then behave as you want.
 
S

Sue

I've tried that, but it displays "0". I want to display the calculation as
currency unless it's a zero value. I don't want to display anything if
there's nothing in the calculated fields.

I'm not getting something here.
:(
 
M

macropod

Hi Sue,

You don't need any vba for this. Instead, you can code the calculation field
as:
{=BkMrk1-BkMrk2 \# $,0.00;-$,0.00;}
where BkMrk1 and BkMrk2 are the bookmark names of your formfields.

The numeric picture switch (ie '\# $,0.00;-$,0.00;') tells Word how to
display +ve;-ve;0 values. In this case, +ve and -ve values are displayed as
dollars and cents, with a thousands separator. By leaving the third
parameter (ie whatever follows the second semi-colon) empty, you can make
Word display nothing when the result of your calculation is zero.

For more information on Word Field Maths, see my 'tutorial' at:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=365442

Cheers
 
S

Sue

I've done what you've suggested, and the $0.00 display is gone now, but now
it's not calculating the fields. This is what I've used:
{=Trans1+Hotel1+Meals1+Car1+Misc1 \# $,0.00;-$,0.00;}
Do I have to format the calculated fields any certain way? Right now they
are formatted as 0.00.

Thanks!
 

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