Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.tables
bob engler
 
Posts: n/a
Default Table calculation problem

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


  #2   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP
 
Posts: n/a
Default Table calculation problem

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

"bob engler" wrote in message
...
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.......




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
Track changes in word table problem GwenP Tables 0 November 11th 05 01:53 PM
More Info On Directory Merge Please JohnB Mailmerge 14 September 6th 05 01:27 PM
Problem with text in table cell sunbeam Microsoft Word Help 1 February 16th 05 10:08 PM
Table Problem Joe New Users 1 January 11th 05 03:57 AM
Row height problem with table in table Stephanie T. Tables 0 November 23rd 04 04:35 PM


All times are GMT +1. The time now is 11:16 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"