To calculate: Instead of all the if then statements just loop through the checkboxes using a for next. Use if then for checked, get text value of each checked & add to sum. Dim sum = 0 For each chkbox in controls.checkbox If chkbox.checked = true then Sum += val(chkbox.text) End if Next Much more cleaner & efficient
To calculate:
Instead of all the if then statements just loop through the checkboxes using a for next. Use if then for checked, get text value of each checked & add to sum.
Dim sum = 0
For each chkbox in controls.checkbox
If chkbox.checked = true then
Sum += val(chkbox.text)
End if
Next
Much more cleaner & efficient
Can this code be used in VB 6.0????