Table calculation problem

B

bob engler

I have a form inside a table that gives a double sum after calculating
totals after I put some VBA in.
I VBAed subtotals at the top of the doc and loaded them into form fields
base1, base2, base3 via
if Premium1 < 200 then Premium1 = 200 endif
ActiveDocument.FormFields("Base1").Result = Premium1
and the same for Base2 and Base3
I then do a Type calculation = Base1+Base2+Base3 and put it into TotalBase
I do they same for Surg1, Surg2, Surg3 and put that into TotSurg
These are OK with the correct totals but
I do a calculation =TotBase+TotSurg and it puts a double number into
TotAnnPrem ie:
TotalBase=2640 TotSurg=0 TotAnnPrem=26402640
It worked OK before the VBA but I don't reference the TotAnnPrem anywhere in
the
code and it sets all the Base totals correctly. Any ideas where to look?
Thanks.......
 
D

Doug Robbins - Word MVP

You will always get this error with a calculation for which the inputs are
themselves the results of another calculation.

You will have to use

TotAnnPrem = Base1+Base2+Base3+Surg1+Surg2+Surg3

--
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