L
Louis
I have the addition of some form fields embedded in a case statement.
I finally have the totals appearing on the form, However the totals are
wrong.
For example if I add 12,233.00 + 12.11 +23.41, I get an answer of $47.52
Below is the code I am using.
Does anyone see what the problem is?
Thanks for your time
Lou
'Set tab to total charges for apartment.
Case "txtcharge8"
sTabTo = "txttotalcharges"
'Add list of charges
Dim c1, c2, c3, c4, c5, c6, c7, c8, tc, bd As Long
c1 = Val(ActiveDocument.FormFields("txtcharge1").Result)
c2 = Val(ActiveDocument.FormFields("txtcharge2").Result)
c3 = Val(ActiveDocument.FormFields("txtcharge3").Result)
c4 = Val(ActiveDocument.FormFields("txtcharge4").Result)
c5 = Val(ActiveDocument.FormFields("txtcharge5").Result)
c6 = Val(ActiveDocument.FormFields("txtcharge6").Result)
c7 = Val(ActiveDocument.FormFields("txtcharge7").Result)
c8 = Val(ActiveDocument.FormFields("txtcharge8").Result)
tc = Val(ActiveDocument.FormFields("txttotalcharges").Result)
bd = Val(ActiveDocument.FormFields("txtbalancedue").Result)
tc = c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8
bd = tc
ActiveDocument.FormFields("txttotalcharges").Result = tc
ActiveDocument.FormFields("txtbalancedue").Result = tc
I finally have the totals appearing on the form, However the totals are
wrong.
For example if I add 12,233.00 + 12.11 +23.41, I get an answer of $47.52
Below is the code I am using.
Does anyone see what the problem is?
Thanks for your time
Lou
'Set tab to total charges for apartment.
Case "txtcharge8"
sTabTo = "txttotalcharges"
'Add list of charges
Dim c1, c2, c3, c4, c5, c6, c7, c8, tc, bd As Long
c1 = Val(ActiveDocument.FormFields("txtcharge1").Result)
c2 = Val(ActiveDocument.FormFields("txtcharge2").Result)
c3 = Val(ActiveDocument.FormFields("txtcharge3").Result)
c4 = Val(ActiveDocument.FormFields("txtcharge4").Result)
c5 = Val(ActiveDocument.FormFields("txtcharge5").Result)
c6 = Val(ActiveDocument.FormFields("txtcharge6").Result)
c7 = Val(ActiveDocument.FormFields("txtcharge7").Result)
c8 = Val(ActiveDocument.FormFields("txtcharge8").Result)
tc = Val(ActiveDocument.FormFields("txttotalcharges").Result)
bd = Val(ActiveDocument.FormFields("txtbalancedue").Result)
tc = c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8
bd = tc
ActiveDocument.FormFields("txttotalcharges").Result = tc
ActiveDocument.FormFields("txtbalancedue").Result = tc