--
Suzanne S. Barnhill
Words into Type
sbar...@zebra.net
Get answers to your software questions via email at
http://www.allexperts.com
In the Table>Formula dialog, place # in the Number Format: box.
Regards,
Doug Robbins - Word MVP
Check <ala...@sprint.ca> wrote in message 36098...@news.wincom.net...
I wasn't feeling real smart last night and missed the fact that you are
using formfields.
I note that you are using the $#,##0.00;($#,##0.00) format in the Number
format box of the formfield properties dialog. If you replace that with
$#,###.##;($#,###.##) you will get just the $ instead of $0.00 if there is
nothing entered into the forms that contribute to the calculation. If you
don't want the $ in empty fields, you have two choices, not have it at all,
or use a macro to calculate the result for each field.
The following are the commands that you would use for such a macro:
' Macro created 10-09-98 by Doug Robbins to prevent display of $0.00
' if product of two fields is zero.
'
text1 = ActiveDocument.FormFields("text1").Result
text2 = ActiveDocument.FormFields("text2").Result
text1 = Val(text1)
text2 = Val(text2)
Text3 = text1 * text2
If Text3 <> 0 Then
Text3 = Format(Text3, "$#,##0.00; ($#,##0.00)")
ActiveDocument.FormFields("text3").Result = Text3
Else
ActiveDocument.FormFields("text3").Result = ""
End If
The above calculates the product of two fields, you would need to modify it
for each case in your form, and a separate macro is required to obtain the
result for each calculation in the form.
The macros should be run on exit from each of the fields that contribute to
the result of each calculation.
Hope this helps.
Regards,
Doug Robbins - Word MVP
-----Original Message-----
From: Andrew Laurie <ala...@sprint.ca>
To: Doug Robbins <doug_r...@email.msn.com>
Date: Friday, September 25, 1998 5:00 AM
Subject: Re: Need to Hide zero values in tables
>Dear Doug,
> Thankyou very much for your reply. However I tried your
>suggestion but was unable to make it work. I will send an attachment for
you
>to show me how it works.
>Regards Andrew Laurie