
Calculating fields in a form
Hi Shona,
I would suggest that you use 0,1,2,3 instead of 1,2,3,4 as the scores.
Then, if these are the only dropdowns in the document and you have another
text formfield (Text1) in which you want the total score to appear, if you
run a macro containing the following commands on exit from each of the
dropdown fields, the Text1 formfield will be updated with the total score
every time the user exits one of the dropdowns:
Dim Score As Integer, ffield As FormField
Result = 0
For Each ffield In ActiveDocument.FormFields
If ffield.Type = wdFieldFormDropDown Then
Score = Score + Val(ffield.Result)
End If
Next ffield
ActiveDocument.FormFields("Text1").Result = Score
Please post any response to the newsgroups for the benefit of others who may
also be following the thread.
Hope this helps,
Doug Robbins - Word MVP
Quote:
> I've got a Word form for users to complete which is an
> assessment for training.
> What I;ve done is put drop down fields to chose a score
> per module i.e.
> 1 = Nothing
> 2 = Little
> 3 = Some
> 4 = Extensive
> What I want to do is in a cell below the table calculate
> these as values. How do I do this? At the very end of the
> assessment I want a calculation that adds all totals to
> make a grand total score.
> Help!