G
Greg Maxey
I have form with a questions and three choices "Yes" "No" "Maybe"
I am using macro to tally the number Yes, No, and Maybe answers. If yes is
checked I want to force No and Maybe to be unchecked. For the first
question Y1, N1 and M1 is used as bookmark names for the checkboxes. I am
using the following macros to with Y1, N1 and M1 to run on exit as
applicable:
Sub Y1()
Dim oForm As Document
Set oForm = ActiveDocument
If oForm.FormFields("Y1").Result = 1 Then
oForm.FormFields("N1").Result = 0
oForm.FormFields("M1").Result = 0
End If
End Sub
Sub N1()
Dim oForm As Document
Set oForm = ActiveDocument
If oForm.FormFields("N1").Result = 1 Then
oForm.FormFields("Y1").Result = 0
oForm.FormFields("M1").Result = 0
End If
End Sub
Sub M1()
Dim oForm As Document
Set oForm = ActiveDocument
If oForm.FormFields("M1").Result = 1 Then
oForm.FormFields("Y1").Result = 0
oForm.FormFields("n1").Result = 0
End If
End Sub
This works for one question but I have to repeat the macro code for question
2 and this action would soon grow tiring :-(
Is there some way to create a macro such that for each checkbox in column 2,
If Result = 1 then set checkbox in adjacent columns (3 and 4) Result = 0?
Thanks
I am using macro to tally the number Yes, No, and Maybe answers. If yes is
checked I want to force No and Maybe to be unchecked. For the first
question Y1, N1 and M1 is used as bookmark names for the checkboxes. I am
using the following macros to with Y1, N1 and M1 to run on exit as
applicable:
Sub Y1()
Dim oForm As Document
Set oForm = ActiveDocument
If oForm.FormFields("Y1").Result = 1 Then
oForm.FormFields("N1").Result = 0
oForm.FormFields("M1").Result = 0
End If
End Sub
Sub N1()
Dim oForm As Document
Set oForm = ActiveDocument
If oForm.FormFields("N1").Result = 1 Then
oForm.FormFields("Y1").Result = 0
oForm.FormFields("M1").Result = 0
End If
End Sub
Sub M1()
Dim oForm As Document
Set oForm = ActiveDocument
If oForm.FormFields("M1").Result = 1 Then
oForm.FormFields("Y1").Result = 0
oForm.FormFields("n1").Result = 0
End If
End Sub
This works for one question but I have to repeat the macro code for question
2 and this action would soon grow tiring :-(
Is there some way to create a macro such that for each checkbox in column 2,
If Result = 1 then set checkbox in adjacent columns (3 and 4) Result = 0?
Thanks