View Single Post
 
Old 06-25-2018, 04:03 PM
tiathetechwriter tiathetechwriter is offline Windows 10 Office 2016
Novice
 
Join Date: Jun 2018
Posts: 3
tiathetechwriter is on a distinguished road
Default I am not a VBScript person

I have never done any VBScript before, never needed to. But I kinda do now.

I have a word document 2016 with 6 drop-down menu content controls, title/labels A, B, C, D, E, F.
Each drop down contains these options, values:
Poor, 1
Fair, 2
Satisfactory, 3
Good, 4
Excellent, 5

Each field is neutral when loading, "Please select a value"

I have a field at bottom I want to have average the values from the 6 dropdowns as they are visited:
((valueA + valueB + valueC +valueD +valueE +valueF)/(number visited))

This is better as a variable:
((totalScore)/(numVisited))

entryValue: [userselected];
global: totalScore: 0;
global: numVisited:0;

After a user selects an option, I want the field to evaluate the selection, use its numerical value to update the totalScore and numVisited variables used for the average, and display the average.

onExit
{If (entryValue= "Poor") {
entryValue+=1;
} else if (entryValue = "Fair") {
entryValue+=2;
} else if (entryValue = "Satisfactory") {
entryValue+=3;
} else if (entryValue = "Good") {
entryValue+=4;
} else {
entryValue+=5;
}
numVisited+=1;
totalScore+=entryValue;
}

I don't know vb, though, and I need some help writing the code for this, and I need to know what field type to use for the average field.

Thank you in advance!

-TiaTheTechWriter
Reply With Quote