I have a sub-form where I gave each check box a value: sum(ICB6, ICB7, ICB11, ICB12, ICB16, ICB17, ICB21, ICB22), but what I want to do now is take this total and divide by the # of check boxes actaully checked. For example; if 2 of the boxes are checked my total is 7, then I want to divide it by 2 (the number of boxes checked) to get 3.5 as my score. I can not figure out how to make that happen?
Views
Replies
Total Likes
If we assume that the Default value of your unchecked checkbox is zero, in the click/change event of the checkbox you can total the value of the checkboxes and divide it by 2.
Var total = (CheckBox1.rawValue + CheckBox2.rawValue+ CheckBox3.rawValue + ....) / 2
Thanks,
Bibhu.
Views
Replies
Total Likes
Thanks for replying, but I do not always want it to divide by 2, that was just an example. I want it to divide by however many check boxes might be checked. So it could be 2 it could be 7 just depending on what is checked.
Views
Replies
Total Likes
Well, then in that case you can use another variable for dividing instead of 2.
Lets say var divider. Then set the value, then divide.
Thanks,
Bibhu.
Views
Replies
Total Likes
Hello,
You can have one hidden text feild and increase the rawValue as per check box selection.
if(CheckBox1.rawValue == true)
TextFeild1.rawValue = 1;
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies