F
Franklin
I have created a Call Monitoring Database, but I need help with the VB code
in order to obtain a total score.
There are 22 questions on the form. (For the sake of this post, let’s say
they’re labeled as Question1, Question2, Question3, etc.)
Each question field is set to “Number†as the data type, with Combo Box
display control, Value List row source type and the row source set to
0;1;2;3;4
Therefore, users will have the option of choosing either 0,1,2,3 or 4 as an
answer choice for each question. (There is a legend provided on the form to
elaborate on the number values).
I also have one field on the bottom of the form (Total Score) with a
“Number†data type, field size: long integer, format: percent.
I need a VB code that will run the following:
To Calculate the Total Score as a Percent:
1. Count the number of Questions with any value other than 0
2. Multiply the count in step #1 by 4
3. Divide the total score by the number obtained in step 2
4. Convert the result in step 4 to a whole number percent
For example, let's say 20 out of the 22 question are answered with a value
other
than 0. Let’s say these 20 questions all had a value of 3.
1. 20 (number of items with a value other than 0)
2. 20 (count from step #1) x 4 = 80
3. 3 (value) x 20 (# of questions with a value other than 0) = 60 (total
score)
60 / 80 (number obtained in step 2) = 0.75
4. 0.75 x 100 = 75%
I’m aware that the database may not be normalized.
I'm very new to this so any help with the VB code, or any other means to
calculate this, would be greatly appreciated. Thank you in advance!
--Frank
in order to obtain a total score.
There are 22 questions on the form. (For the sake of this post, let’s say
they’re labeled as Question1, Question2, Question3, etc.)
Each question field is set to “Number†as the data type, with Combo Box
display control, Value List row source type and the row source set to
0;1;2;3;4
Therefore, users will have the option of choosing either 0,1,2,3 or 4 as an
answer choice for each question. (There is a legend provided on the form to
elaborate on the number values).
I also have one field on the bottom of the form (Total Score) with a
“Number†data type, field size: long integer, format: percent.
I need a VB code that will run the following:
To Calculate the Total Score as a Percent:
1. Count the number of Questions with any value other than 0
2. Multiply the count in step #1 by 4
3. Divide the total score by the number obtained in step 2
4. Convert the result in step 4 to a whole number percent
For example, let's say 20 out of the 22 question are answered with a value
other
than 0. Let’s say these 20 questions all had a value of 3.
1. 20 (number of items with a value other than 0)
2. 20 (count from step #1) x 4 = 80
3. 3 (value) x 20 (# of questions with a value other than 0) = 60 (total
score)
60 / 80 (number obtained in step 2) = 0.75
4. 0.75 x 100 = 75%
I’m aware that the database may not be normalized.
I'm very new to this so any help with the VB code, or any other means to
calculate this, would be greatly appreciated. Thank you in advance!
--Frank