Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Negative Numbers in Word 97 Form Fields 3

Status
Not open for further replies.

Anthony904

IS-IT--Management
Jul 15, 2004
153
US
I am doing some calculations in Word 97. I am using some form fields. Some of the calculations displays negative numbers.

How can I prevent it from displaying a negative number. Maybe display a zero instead.

ie..

=text1-text2

Thanks!
 
Use a format with 3 sections, eg:
#;0;0

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I'm not sure I understand you..

I entered

#;0;0

in the Number Format field..

and I'm still getting a negative number..

Thanks for responding..
 
And this ?
#;;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi Anthony,

Do not use the Number Format in the Form Field Options Dialog - clear it out and edit the Form Field directly.

Press Alt+F9
Your Field will now show up like this:[highlight #DDDDDD]{ FORMTEXT { =Text1-Text2 } }[/highlight]
Change it to look like this:[highlight #DDDDDD]{ FORMTEXT { =Text1-Text2 \# #;'0';0 } }[/highlight]
Press Alt+F9 again

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
Excel VBA Training and more Help at VBAExpress[
 
Hi Tony,

Formfield calculations are buggy, at best. Besides, you don't need them. In your example, you'd get exactly the same result with:
{=Text1-Text2 \# #;'0';0}
and Anthony's desired result with:
{=Text1-Text2 \# 0;;0}
which will suppress the display of -ve values only.

Alternatively, if the absolute difference between two values is needed, you can use:
{=ABS(Text1-Text2)}
without the numeric picture switch.

Cheers
 
Ok,

I think this is working.. but..

when the number is not negative.. nothing appears in my field..

ie..

20-40 = displays 0
but
40-20 = displays nothing

Thanks for the help guys!
 
Sorry guys..

I think it was because I had..

#;;

still stuck in the number format.

I removed it.. and it seems to be working fine now..

THANKS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top