jeudi 2 avril 2020

how to count true checkboxes in a word form?

I have 5 checkboxes in a Word form (.dotm). Each time a checkbox = true, a result box will increase by 15 (for € 15 ..) and will decrease by 15 if the checkbox = false.

I wrote that for the moment but, the result stay at 15 even if I pass checkbox=false:

Sub totalWeek()

    Dim monday As CheckBox
    Dim summary As FormField

    Set monday = ActiveDocument.FormFields("CaseACocher8").CheckBox
    Set summary = ActiveDocument.FormFields("totalSemaine")

    If monday.Value = True Then
    summary.Result = 15
    Else: summary.Result = 0
    End If

End Sub

What's wrong ?




Aucun commentaire:

Enregistrer un commentaire