View Single Post
 
Old 01-04-2015, 06:22 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

While what you ask is possible. It requires a lot of error checking to ensure that the count is a true reflection of the selections. It requires the user to tab through each to increment the values. Simply leaving the values at their defaults will not increment the count.

I believe it would make more sense to use a macro to count the values after they have all been completed. That way there should be no false values. e.g.

Code:
Sub CountValues()
Dim A_Count As Long
Dim B_Count As Long
Dim C_Count As Long
Dim oFF As FormField
    A_Count = 0
    B_Count = 0
    C_Count = 0
    For Each oFF In ActiveDocument.FormFields
        If oFF.Type = wdFieldFormDropDown Then
            Select Case oFF.Result
                Case "A": A_Count = A_Count + 1
                Case "B": B_Count = B_Count + 1
                Case "C": C_Count = C_Count + 1
                Case Else
            End Select
        End If
    Next oFF
    MsgBox "A - Selected " & A_Count & vbCr & _
           "B - Selected " & B_Count & vbCr & _
           "C - Selected " & C_Count
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote