#1   Report Post  
DomMar
 
Posts: n/a
Default Hiding zero values

I want to have a calculation field in a form show as blank (spaces) when the
value is zero.
  #2   Report Post  
Greg Maxey
 
Posts: n/a
Default

DomMar,

You can use a regulare formula field (vice calculation field) with a numeric
switch to hide the zero.

Example. Say you have Text1 and Text2 as the varialbles. Set both to
calculate on exit. Enter the following formula field.

{ =(Text1+Text1) \# "#;-#; " }

Note the field braces { } are entered with CTRL+F9. Once you have the
field entered then toggle the code and protect the form.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I want to have a calculation field in a form show as blank (spaces)
when the value is zero.



  #3   Report Post  
DomMar
 
Posts: n/a
Default

I'm sorry I was not clearer. The numeric format for the field includes a $ as
in
$#,##0.00;($#,##0.00). I tried using all # but the $ showed when the field
was zero. Is there a macro that I can use to change the format when the value
is zero?

"Greg Maxey" wrote:

DomMar,

You can use a regulare formula field (vice calculation field) with a numeric
switch to hide the zero.

Example. Say you have Text1 and Text2 as the varialbles. Set both to
calculate on exit. Enter the following formula field.

{ =(Text1+Text1) \# "#;-#; " }

Note the field braces { } are entered with CTRL+F9. Once you have the
field entered then toggle the code and protect the form.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I want to have a calculation field in a form show as blank (spaces)
when the value is zero.




  #4   Report Post  
Greg Maxey
 
Posts: n/a
Default

DomMar.

Again you don't need a macro. A numeric switch will work fine:

{ =(Text1+Text2) \# "$,#.00;-$,#.00; " }

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I'm sorry I was not clearer. The numeric format for the field
includes a $ as in
$#,##0.00;($#,##0.00). I tried using all # but the $ showed when the
field was zero. Is there a macro that I can use to change the format
when the value is zero?

"Greg Maxey" wrote:

DomMar,

You can use a regulare formula field (vice calculation field) with a
numeric switch to hide the zero.

Example. Say you have Text1 and Text2 as the varialbles. Set both
to calculate on exit. Enter the following formula field.

{ =(Text1+Text1) \# "#;-#; " }

Note the field braces { } are entered with CTRL+F9. Once you have
the field entered then toggle the code and protect the form.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I want to have a calculation field in a form show as blank (spaces)
when the value is zero.



  #5   Report Post  
Greg Maxey
 
Posts: n/a
Default

or { =(Text1+Text2) \# "$,#.00;($,#.00); " }

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

Greg Maxey wrote:
DomMar.

Again you don't need a macro. A numeric switch will work fine:

{ =(Text1+Text2) \# "$,#.00;-$,#.00; " }


DomMar wrote:
I'm sorry I was not clearer. The numeric format for the field
includes a $ as in
$#,##0.00;($#,##0.00). I tried using all # but the $ showed when the
field was zero. Is there a macro that I can use to change the format
when the value is zero?

"Greg Maxey" wrote:

DomMar,

You can use a regulare formula field (vice calculation field) with a
numeric switch to hide the zero.

Example. Say you have Text1 and Text2 as the varialbles. Set both
to calculate on exit. Enter the following formula field.

{ =(Text1+Text1) \# "#;-#; " }

Note the field braces { } are entered with CTRL+F9. Once you have
the field entered then toggle the code and protect the form.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I want to have a calculation field in a form show as blank (spaces)
when the value is zero.





  #6   Report Post  
DomMar
 
Posts: n/a
Default

I tried to use Ctrl+F9 but it could not be entered. I tried with both a
calculation field and a formula field. Neither dialog box accepts ctrl+F9. My
document has a macro which will update all fields in document. I also tried
using keyboard {} but they did not work.

Regards,

DomMar

"Greg Maxey" wrote:

or { =(Text1+Text2) \# "$,#.00;($,#.00); " }

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

Greg Maxey wrote:
DomMar.

Again you don't need a macro. A numeric switch will work fine:

{ =(Text1+Text2) \# "$,#.00;-$,#.00; " }


DomMar wrote:
I'm sorry I was not clearer. The numeric format for the field
includes a $ as in
$#,##0.00;($#,##0.00). I tried using all # but the $ showed when the
field was zero. Is there a macro that I can use to change the format
when the value is zero?

"Greg Maxey" wrote:

DomMar,

You can use a regulare formula field (vice calculation field) with a
numeric switch to hide the zero.

Example. Say you have Text1 and Text2 as the varialbles. Set both
to calculate on exit. Enter the following formula field.

{ =(Text1+Text1) \# "#;-#; " }

Note the field braces { } are entered with CTRL+F9. Once you have
the field entered then toggle the code and protect the form.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I want to have a calculation field in a form show as blank (spaces)
when the value is zero.




  #7   Report Post  
Greg Maxey
 
Posts: n/a
Default

DomMar,

Forget the calculation field. Unprotect the document and use CTRL+F9 to
create a set of field code delimiters { } type the formula and format
switch directly inside the delimiters. Select the field and toggle the
code. Ensure both (or all) variable formfields are set to "calculate on
exit." Reprotect the form.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I tried to use Ctrl+F9 but it could not be entered. I tried with both
a calculation field and a formula field. Neither dialog box accepts
ctrl+F9. My document has a macro which will update all fields in
document. I also tried using keyboard {} but they did not work.

Regards,

DomMar

"Greg Maxey" wrote:

or { =(Text1+Text2) \# "$,#.00;($,#.00); " }

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

Greg Maxey wrote:
DomMar.

Again you don't need a macro. A numeric switch will work fine:

{ =(Text1+Text2) \# "$,#.00;-$,#.00; " }


DomMar wrote:
I'm sorry I was not clearer. The numeric format for the field
includes a $ as in
$#,##0.00;($#,##0.00). I tried using all # but the $ showed when
the field was zero. Is there a macro that I can use to change the
format when the value is zero?

"Greg Maxey" wrote:

DomMar,

You can use a regulare formula field (vice calculation field)
with a numeric switch to hide the zero.

Example. Say you have Text1 and Text2 as the varialbles. Set
both
to calculate on exit. Enter the following formula field.

{ =(Text1+Text1) \# "#;-#; " }

Note the field braces { } are entered with CTRL+F9. Once you
have
the field entered then toggle the code and protect the form.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I want to have a calculation field in a form show as blank
(spaces) when the value is zero.



  #8   Report Post  
DomMar
 
Posts: n/a
Default

Greg,

Thank you I finally got it. Is there a way I can do the same for an
enterable numeric text field. Hrs. * Rate = Amt. Amt was the field you
pounded into my dense head. I'd like to do the same for Rate which is
enterable.

Regards,

DomMar

"Greg Maxey" wrote:

DomMar,

Forget the calculation field. Unprotect the document and use CTRL+F9 to
create a set of field code delimiters { } type the formula and format
switch directly inside the delimiters. Select the field and toggle the
code. Ensure both (or all) variable formfields are set to "calculate on
exit." Reprotect the form.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I tried to use Ctrl+F9 but it could not be entered. I tried with both
a calculation field and a formula field. Neither dialog box accepts
ctrl+F9. My document has a macro which will update all fields in
document. I also tried using keyboard {} but they did not work.

Regards,

DomMar

"Greg Maxey" wrote:

or { =(Text1+Text2) \# "$,#.00;($,#.00); " }

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

Greg Maxey wrote:
DomMar.

Again you don't need a macro. A numeric switch will work fine:

{ =(Text1+Text2) \# "$,#.00;-$,#.00; " }


DomMar wrote:
I'm sorry I was not clearer. The numeric format for the field
includes a $ as in
$#,##0.00;($#,##0.00). I tried using all # but the $ showed when
the field was zero. Is there a macro that I can use to change the
format when the value is zero?

"Greg Maxey" wrote:

DomMar,

You can use a regulare formula field (vice calculation field)
with a numeric switch to hide the zero.

Example. Say you have Text1 and Text2 as the varialbles. Set
both
to calculate on exit. Enter the following formula field.

{ =(Text1+Text1) \# "#;-#; " }

Note the field braces { } are entered with CTRL+F9. Once you
have
the field entered then toggle the code and protect the form.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I want to have a calculation field in a form show as blank
(spaces) when the value is zero.




  #9   Report Post  
Greg Maxey
 
Posts: n/a
Default

DomMar,

All I can suggest is an on exit macro to set the value to " " if the value
on exit is "0"

Sub Test()
If ActiveDocument.FormFields("Text2").Result = "0" Then
ActiveDocument.FormFields("Text2").Result = " "
End If

End Sub


--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
Greg,

Thank you I finally got it. Is there a way I can do the same for an
enterable numeric text field. Hrs. * Rate = Amt. Amt was the field you
pounded into my dense head. I'd like to do the same for Rate which is
enterable.

Regards,

DomMar

"Greg Maxey" wrote:

DomMar,

Forget the calculation field. Unprotect the document and use
CTRL+F9 to create a set of field code delimiters { } type the
formula and format switch directly inside the delimiters. Select
the field and toggle the code. Ensure both (or all) variable
formfields are set to "calculate on exit." Reprotect the form.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I tried to use Ctrl+F9 but it could not be entered. I tried with
both a calculation field and a formula field. Neither dialog box
accepts ctrl+F9. My document has a macro which will update all
fields in document. I also tried using keyboard {} but they did not
work.

Regards,

DomMar

"Greg Maxey" wrote:

or { =(Text1+Text2) \# "$,#.00;($,#.00); " }

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

Greg Maxey wrote:
DomMar.

Again you don't need a macro. A numeric switch will work fine:

{ =(Text1+Text2) \# "$,#.00;-$,#.00; " }


DomMar wrote:
I'm sorry I was not clearer. The numeric format for the field
includes a $ as in
$#,##0.00;($#,##0.00). I tried using all # but the $ showed when
the field was zero. Is there a macro that I can use to change the
format when the value is zero?

"Greg Maxey" wrote:

DomMar,

You can use a regulare formula field (vice calculation field)
with a numeric switch to hide the zero.

Example. Say you have Text1 and Text2 as the varialbles. Set
both
to calculate on exit. Enter the following formula field.

{ =(Text1+Text1) \# "#;-#; " }

Note the field braces { } are entered with CTRL+F9. Once you
have
the field entered then toggle the code and protect the form.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I want to have a calculation field in a form show as blank
(spaces) when the value is zero.



  #10   Report Post  
DomMar
 
Posts: n/a
Default

Thanks you have been very Helpful.

"Greg Maxey" wrote:

DomMar,

All I can suggest is an on exit macro to set the value to " " if the value
on exit is "0"

Sub Test()
If ActiveDocument.FormFields("Text2").Result = "0" Then
ActiveDocument.FormFields("Text2").Result = " "
End If

End Sub


--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
Greg,

Thank you I finally got it. Is there a way I can do the same for an
enterable numeric text field. Hrs. * Rate = Amt. Amt was the field you
pounded into my dense head. I'd like to do the same for Rate which is
enterable.

Regards,

DomMar

"Greg Maxey" wrote:

DomMar,

Forget the calculation field. Unprotect the document and use
CTRL+F9 to create a set of field code delimiters { } type the
formula and format switch directly inside the delimiters. Select
the field and toggle the code. Ensure both (or all) variable
formfields are set to "calculate on exit." Reprotect the form.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I tried to use Ctrl+F9 but it could not be entered. I tried with
both a calculation field and a formula field. Neither dialog box
accepts ctrl+F9. My document has a macro which will update all
fields in document. I also tried using keyboard {} but they did not
work.

Regards,

DomMar

"Greg Maxey" wrote:

or { =(Text1+Text2) \# "$,#.00;($,#.00); " }

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

Greg Maxey wrote:
DomMar.

Again you don't need a macro. A numeric switch will work fine:

{ =(Text1+Text2) \# "$,#.00;-$,#.00; " }


DomMar wrote:
I'm sorry I was not clearer. The numeric format for the field
includes a $ as in
$#,##0.00;($#,##0.00). I tried using all # but the $ showed when
the field was zero. Is there a macro that I can use to change the
format when the value is zero?

"Greg Maxey" wrote:

DomMar,

You can use a regulare formula field (vice calculation field)
with a numeric switch to hide the zero.

Example. Say you have Text1 and Text2 as the varialbles. Set
both
to calculate on exit. Enter the following formula field.

{ =(Text1+Text1) \# "#;-#; " }

Note the field braces { } are entered with CTRL+F9. Once you
have
the field entered then toggle the code and protect the form.

--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

DomMar wrote:
I want to have a calculation field in a form show as blank
(spaces) when the value is zero.




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
remove mergefields, keep values Jim Zoupas Mailmerge 2 March 15th 05 08:25 AM
Merging past specified values?? FNORD Mailmerge 0 February 14th 05 09:13 PM
where are the macros hiding Jeff Brown Microsoft Word Help 1 February 4th 05 06:23 PM
Specifying CC: and BCC: Values for Mail Merge to Email Mark V Mailmerge 2 November 29th 04 03:55 PM
Linked values WillieWorstel Microsoft Word Help 1 November 26th 04 05:07 PM


All times are GMT +1. The time now is 06:31 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"