B
balan_radu2003
Hello,
So I have a Form and in there I have several check boxes. Some of them
have the same value, like 1 $. I want when I choose more check boxes
he multiplies the quantity of check boxes with 1 $.
Example:
Check Box 1 is checked, Check Box 4 is checked, Check Box 7 is also
checked. The Check Boxes in between are not checked. All this Check
Boxes (from 1 to 7) have the value of 1 $. So because I choose 1, 4
and 7 I will have the Sum of 3 $. If I choose also Check Box 5 for
example the sum should change into 4 $ and so on. But these Check
Boxes are conditioned by a Size Combo Box with the values: "little",
"middle" and "big"... so if I choose "middle" in the Combo box the
value of the Check Boxes which is the same for all check boxes becomes
now 2 $. So if I have chosen "middle" in the Combo Box and the Check
Box 1 is checked, Check Box 4 is checked and Check Box 7 is also
checked then he has to add 2$ + 2$ + 2$. Same story for "big" but the
Check boxes have now the value of 3$.... (the 1$ example was for the
"little" value of the combo box)
I already thought of a code like this, but which is to long if I would
make it for all Check Boxes and all Combo Box values, and I want a
shorter version if it is possible:
total = 0
If (CheckBox1 = True) Then
If (cboCourse = "Big") Then
total = total + 3
End If
End If
If (CheckBox2 = True) Then
If (cboCourse = "Big") Then
total = total + 3
End If
End If
If (CheckBox3 = True) Then
If (cboCourse = "Big") Then
total = total + 3
End If
End If
If (CheckBox4 = True) Then
If (cboCourse = "Big") Then
total = total + 3
End If
End If
.....
If (CheckBox1 = True) Then
If (cboCourse = "middle") Then
total = total + 2
End If
End If
If (CheckBox2 = True) Then
If (cboCourse = "middle") Then
total = total + 2
End If
End If
.....
If (CheckBox1 = True) Then
If (cboCourse = "little") Then
total = total + 1
End If
End If
If (CheckBox2 = True) Then
If (cboCourse = "little") Then
total = total + 1
End If
End If
.....
ActiveCell.Offset(0, 9).Value = total
Please use also the codes: "total = 0" and "ActiveCell.Offset(0,
9).Value = total"
Thank you very much!
Radu
So I have a Form and in there I have several check boxes. Some of them
have the same value, like 1 $. I want when I choose more check boxes
he multiplies the quantity of check boxes with 1 $.
Example:
Check Box 1 is checked, Check Box 4 is checked, Check Box 7 is also
checked. The Check Boxes in between are not checked. All this Check
Boxes (from 1 to 7) have the value of 1 $. So because I choose 1, 4
and 7 I will have the Sum of 3 $. If I choose also Check Box 5 for
example the sum should change into 4 $ and so on. But these Check
Boxes are conditioned by a Size Combo Box with the values: "little",
"middle" and "big"... so if I choose "middle" in the Combo box the
value of the Check Boxes which is the same for all check boxes becomes
now 2 $. So if I have chosen "middle" in the Combo Box and the Check
Box 1 is checked, Check Box 4 is checked and Check Box 7 is also
checked then he has to add 2$ + 2$ + 2$. Same story for "big" but the
Check boxes have now the value of 3$.... (the 1$ example was for the
"little" value of the combo box)
I already thought of a code like this, but which is to long if I would
make it for all Check Boxes and all Combo Box values, and I want a
shorter version if it is possible:
total = 0
If (CheckBox1 = True) Then
If (cboCourse = "Big") Then
total = total + 3
End If
End If
If (CheckBox2 = True) Then
If (cboCourse = "Big") Then
total = total + 3
End If
End If
If (CheckBox3 = True) Then
If (cboCourse = "Big") Then
total = total + 3
End If
End If
If (CheckBox4 = True) Then
If (cboCourse = "Big") Then
total = total + 3
End If
End If
.....
If (CheckBox1 = True) Then
If (cboCourse = "middle") Then
total = total + 2
End If
End If
If (CheckBox2 = True) Then
If (cboCourse = "middle") Then
total = total + 2
End If
End If
.....
If (CheckBox1 = True) Then
If (cboCourse = "little") Then
total = total + 1
End If
End If
If (CheckBox2 = True) Then
If (cboCourse = "little") Then
total = total + 1
End If
End If
.....
ActiveCell.Offset(0, 9).Value = total
Please use also the codes: "total = 0" and "ActiveCell.Offset(0,
9).Value = total"
Thank you very much!
Radu