Can you eliminate $0.00 in form field expression results?

G

GD Gerlach

I have created a simple invoice using Word 97. There are 20 lines for 20
items. Each line has a "quantity" field and a "price" field. The "total"
field for each line has the formula, or what Word 97 calls the expression.
$0.00 shows up in each of the unused lines' total boxes. Is there any way to
eliminate the $0.00 totals on those lines where no quantity or price has been
entered?
 
K

Kevin B

I don't remember if form fields had a default value, but if you turn on
design mode and double click on the form field, if there is a default number
value of $0.00, delete it.
 
G

GD Gerlach

Not sure what you mean by design mode... In Word 97 there's a
Protect/Unprotect icon (little padlock). Is that what you are talking about?
If I go into the unprotect mode and double click a form field, I don't see
any kind of default number. I'm wondering if there is something I could add
to the formula (expression) to hide the $0.00.
 
G

Graham Mayor

I take it you are using form fields and that you have some calculated form
fields to derive the sub totals?
Instead of using form fields for the sub totals use calculated Word fields.

Presumably you have a quantity and a unit price as fields?. Right click each
field and select properties. Note the bookmark names of those fields and
check the calculate on exit check boxes.
In the sub total fields use a Word formula field eg {= {Text1} * {Text2} \#
"$,0.00;;"}
This will only show an amount when the result of that calculation is greater
than 0.

You can use a formula field to calculate the final totals also.

See also http://www.gmayor.com/formatting_word_fields.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
T

Tony Jollans

You can do it with formfields as well. The trick is to add the formatting to
the field code and not do it via the form field options dialog.

In the dialog make sure the format box is empty.
Close the dialog.
Press Alt+F9 to toggle the field codes view.
Your field should look something like:
{ FORMTEXT { =Quantity * Price } }
Change it to this:
{ FORMTEXT { =Quantity * Price } \# "$,0.00;-$,0.00;" }
Press Alt+F9 to toggle field codes again
 
G

GD Gerlach

That did the trick. I noticed that when I hit alt F9 the formula appears but
I can't see the entire formula because the font is too big and/or the cell
too small. It won't let me scroll through the formula using the right and
left arrow keys; when it gets to the end of the visible part of the formula,
the cursor goes to another cell. The only work around I came up with was
reducing the font size of the formula but I was wondering if there was
another option.
 

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