With three sets of five option buttons named:
Option 11, Option 21, Option 31, Option 41, Option 51
Option 12, Option 22, Option 32, Option 42, Option 52
Option 13, Option 23, Option 33, Option 43, Option 53
and the formfields named as you have them, this is the code that you would
need:
Public o11 As Long, o12 As Long, o13 As Long, one As Long
Public o21 As Long, o22 As Long, o23 As Long, two As Long
Public o31 As Long, o32 As Long, o33 As Long, three As Long
Public o41 As Long, o42 As Long, o43 As Long, four As Long
Public o51 As Long, o52 As Long, o53 As Long, five As Long
Private Sub Option11_Click()
If Option11.Value = True Then
o11 = 1
o21 = 0
o31 = 0
o41 = 0
o51 = 0
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option21_Click()
If Option21.Value = True Then
o11 = 0
o21 = 1
o31 = 0
o41 = 0
o51 = 0
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option31_Click()
If Option31.Value = True Then
o11 = 0
o21 = 0
o31 = 1
o41 = 0
o51 = 0
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option41_Click()
If Option41.Value = True Then
o11 = 0
o21 = 0
o31 = 0
o41 = 1
o51 = 0
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option51_Click()
If Option51.Value = True Then
o11 = 0
o21 = 0
o31 = 0
o41 = 0
o51 = 1
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option12_Click()
If Option12.Value = True Then
o12 = 1
o22 = 0
o32 = 0
o42 = 0
o52 = 0
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option22_Click()
If Option22.Value = True Then
o12 = 0
o22 = 1
o32 = 0
o42 = 0
o52 = 0
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option32_Click()
If Option32.Value = True Then
o12 = 0
o22 = 0
o32 = 1
o42 = 0
o52 = 0
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option42_Click()
If Option42.Value = True Then
o12 = 0
o22 = 0
o32 = 0
o42 = 1
o52 = 0
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option52_Click()
If Option52.Value = True Then
o12 = 0
o22 = 0
o32 = 0
o42 = 0
o52 = 1
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option13_Click()
If Option13.Value = True Then
o13 = 1
o23 = 0
o33 = 0
o43 = 0
o53 = 0
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option23_Click()
If Option23.Value = True Then
o13 = 0
o23 = 1
o33 = 0
o43 = 0
o53 = 0
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option33_Click()
If Option33.Value = True Then
o13 = 0
o23 = 0
o33 = 1
o43 = 0
o53 = 0
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option43_Click()
If Option43.Value = True Then
o13 = 0
o23 = 0
o33 = 0
o43 = 1
o53 = 0
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
Private Sub Option53_Click()
If Option53.Value = True Then
o13 = 0
o23 = 0
o33 = 0
o43 = 0
o53 = 1
End If
one = o11 + o12 + o13
two = o21 + o22 + o23
three = o31 + o32 + o33
four = o41 + o42 + o43
five = o51 + o52 + o53
With ActiveDocument
.FormFields("Ones").Result = one
.FormFields("Twos").Result = two
.FormFields("Threes").Result = three
.FormFields("Fours").Result = four
.FormFields("Fives").Result = five
End With
End Sub
--
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