Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2005

Tip: Looking for answers? Try searching our database.

Zero Values

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sue - 05 Oct 2005 20:37 GMT
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!
Tony Jollans - 05 Oct 2005 21:15 GMT
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.

--
Enjoy,
Tony

> 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!
Sue - 06 Oct 2005 17:41 GMT
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.
:(

> You can use number formatting pictures, but .. don't do it through the
> dialog.
[quoted text clipped - 24 lines]
> >
> > Thanks!
macropod - 07 Oct 2005 06:04 GMT
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

> 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
[quoted text clipped - 31 lines]
> > >
> > > Thanks!
Sue - 18 Oct 2005 17:41 GMT
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!

> Hi Sue,
>
[quoted text clipped - 53 lines]
> > > >
> > > > Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.