Problem with conditional calculation in a table

T

Tom Stanley

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/tutorial...9e-ea76e8506a27/build-a-c-dns-mx-mail-re.aspx
 
S

Suzanne S. Barnhill

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
 
M

macropod

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]


in message news:[email protected]...
 
T

Tom Stanley

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

Thanks Again,

Tom Stanley



macropod wrote:

Re: 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]


in message
EggHeadCafe - Software Developer Portal of Choice
Dr. Dotnetsky's Cool .NET Tips and Tricks #17
http://www.eggheadcafe.com/tutorial...ad65-add4829715f8/dr-dotnetskys-cool-net.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top