A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Problem with conditional calculation in a table



 
 
Thread Tools Display Modes
  #1  
Old October 2nd, 2009, 09:08 PM posted to microsoft.public.word.tables
Tom Stanley[_2_]
external usenet poster
 
Posts: 2
Default Problem with conditional calculation in a table

I have an invoice that I want to create a conditional expression to display nothing on a zero result. The result is displayed in a Text Form Field (Type = Calculation, Maximum Length = Unlimited, Number Format = nothing, Bookmark = Text2, Calculate on Exit is Checked) Expression is as follows { IF {Quantity_1} 0 { = {Quantity_1} * {Price_1} \# $#,##0.00; } "" }

My problem is that when I protect the document and enter in info for Quantity_1 and Price_1 the result will not calculate and display. Both Quantity_1 and Price_1 are Number type Form Fields with Default numbers of 0. This one is driving me nuts and it's probably just a simple syntax error, but I can't seem to find the solution.........

EggHeadCafe - Software Developer Portal of Choice
Build A C# DNS MX Mail Record Query Class
http://www.eggheadcafe.com/tutorials...x-mail-re.aspx
  #2  
Old October 2nd, 2009, 09:24 PM posted to microsoft.public.word.tables
Suzanne S. Barnhill
external usenet poster
 
Posts: 31,786
Default Problem with conditional calculation in a table

I may be off the mark, but I don't think you need to have this field in a
text form field. What you do need for IF fields in a protected form,
however, is to use REF fields for your bookmarks:

{ IF { REF Quantity_1 } 0 { = { REF Quantity_1 } * { REF Price_1 } \#
$#,##0.00; } }

You can omit the final "" since the FalseText is never required when it is
to be blank.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

Tom Stanley wrote in message ...
I have an invoice that I want to create a conditional expression to display
nothing on a zero result. The result is displayed in a Text Form Field
(Type = Calculation, Maximum Length = Unlimited, Number Format = nothing,
Bookmark = Text2, Calculate on Exit is Checked) Expression is as follows
{ IF {Quantity_1} 0 { = {Quantity_1} * {Price_1} \# $#,##0.00; } "" }

My problem is that when I protect the document and enter in info for
Quantity_1 and Price_1 the result will not calculate and display. Both
Quantity_1 and Price_1 are Number type Form Fields with Default numbers of
0. This one is driving me nuts and it's probably just a simple syntax
error, but I can't seem to find the solution.........

EggHeadCafe - Software Developer Portal of Choice
Build A C# DNS MX Mail Record Query Class
http://www.eggheadcafe.com/tutorials...x-mail-re.aspx


  #3  
Old October 2nd, 2009, 10:37 PM posted to microsoft.public.word.tables
macropod[_2_]
external usenet poster
 
Posts: 2,402
Default Problem with conditional calculation in a table

Hi Tom,

Instead of a calculation formfield, you could use a formula field coded as:
{=Quantity_1*Price_1 \# "$,0.00;;"}

--
Cheers
macropod
[Microsoft MVP - Word]


"Tom Stanley" wrote in message ...
I have an invoice that I want to create a conditional expression to display nothing on a zero result. The result is displayed in a
Text Form Field (Type = Calculation, Maximum Length = Unlimited, Number Format = nothing, Bookmark = Text2, Calculate on Exit is
Checked) Expression is as follows { IF {Quantity_1} 0 { = {Quantity_1} * {Price_1} \# $#,##0.00; } "" }

My problem is that when I protect the document and enter in info for Quantity_1 and Price_1 the result will not calculate and
display. Both Quantity_1 and Price_1 are Number type Form Fields with Default numbers of 0. This one is driving me nuts and it's
probably just a simple syntax error, but I can't seem to find the solution.........

EggHeadCafe - Software Developer Portal of Choice
Build A C# DNS MX Mail Record Query Class
http://www.eggheadcafe.com/tutorials...x-mail-re.aspx


  #4  
Old October 4th, 2009, 09:13 PM posted to microsoft.public.word.tables
Tom Stanley[_2_]
external usenet poster
 
Posts: 2
Default Thanks!

Both Solutions worked.......Too bad the Word help documentation doesn't cover this subject a little better

Thanks Again,

Tom Stanley



macropod wrote:

Problem with conditional calculation in a table
02-Oct-09

Hi Tom,

Instead of a calculation formfield, you could use a formula field coded as:
{=Quantity_1*Price_1 \# "$,0.00;;"}

--
Cheers
macropod
[Microsoft MVP - Word]


"Tom Stanley" wrote in message ...

EggHeadCafe - Software Developer Portal of Choice
Dr. Dotnetsky's Cool .NET Tips and Tricks #17
http://www.eggheadcafe.com/tutorials...-cool-net.aspx
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


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


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.