Dim myresult As Double
If ActiveDocument.FormFields("CompTime").CheckBox.Value = False Then
ActiveDocument.FormFields("Text3").Result = ""
Else
If ActiveDocument.FormFields("Pay").CheckBox.Value = False Then
myresult = Val(ActiveDocument.FormFields("Text1").Result) +
Val(ActiveDocument.FormFields("Text2").Result)
If myresult > 0 Then
ActiveDocument.FormFields("Text3").Result = Format(myresult,
"##0.00")
ElseIf myresult < 0 Then
ActiveDocument.FormFields("Text3").Result = Format(0 - myresult,
"(##0.00)")
Else
ActiveDocument.FormFields("Text3").Result = ""
End If
Else
ActiveDocument.FormFields("Text3").Result = ""
End If
End If
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
"mickey" <anon...@discussions.microsoft.com> wrote in message
news:2b5301c4286f$0729b030$a401...@phx.gbl...
Dim i As Long, sumofchecks As Long
sumofchecks = 0
For i = 1 To Selection.Tables(1).Rows.Count - 1
sumofchecks = sumofchecks -
Selection.Columns(1).Cells(i).Range.FormFields(1).CheckBox.Value
Next i
ActiveDocument.FormFields("SumofChecks").Result = sumofchecks
This assumes that there are check boxes in all rows but the last. If there
is no check box in the first row, change For i = 1 to For i = 2
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
"Janice" <anon...@discussions.microsoft.com> wrote in message
news:4f4e01c42c72$c60c1130$a301...@phx.gbl...