Calculated fields are doubled.

A

Andrea Jones

It's because when the calculation looks at a form field like your 'Total
Deductions' it runs the contents of that form field again thus doubling its
result. You can get the correct answer in your form by doing something like
=Gross-(Gross*Contingency)-CostsAdvanced-Postage-Copies-Telephone-Administrative-FinanceCharges-Amount1-Amount2-Amount3-Amount4.

Personally I would use a macro that runs as you exit each form field and
recalculates everything:

Sub calcmacro()
Dim x As Double
Dim y As Double
Dim tot As Double
x=0
y=0
tot=0
x=Val(ActiveDocument.FormFields("Val1").Result)
y=Val(ActiveDocument.FormFields("Val2").Result)
tot=x+y
ActiveDocument.FormFields("Total").Result=tot
End Sub

The above macro will total two form fields bookmarked Val1 and Val2 and put
the answer in the form field bookmarked Total. Set the calcmacro to run on
exiting every form field. The form fields must be of a number or text type
(the Val function will make it work even on text fields but currency doesn't
work). The Val part also deals with any rounding problems you may get from
adding taxes so your total is the expected answer.

Andrea Jones
http://www.allaboutoffice.co.uk
http://www.stratatraining.co.uk
http://www.allaboutclait.com
 
D

Doug Robbins

In a formfield calculation, you cannot use a formfield that contains the
result of another calculation.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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