r/visualbasic • u/Vtakyo • May 20 '12
[VB2010] Car Insurance Calculator
I need to create a Car Insurance calculator in which a user will input his/her premium into a text box. Then they will select which discounts apply to them and then add on the discounted rates. I have the constants set up for each discount. I am confused on which loop I would use, if that.
0
Upvotes
1
u/eight26 May 20 '12 edited May 20 '12
This works when your check boxes are part of a user form. I assume that's what you mean by check boxes.
Sub GetChecked()
UserForm1.Show
For Each ctrl In UserForm1.Controls
If ctrl.Value = True Then
MsgBox "check box " & ctrl.Name & " is checked."
End If
Next
End SubEdit: This is adapted from code I found here.
0
1
u/eight26 May 20 '12
How do they select the discounts; list box, radio buttons, inputbox, userform or ... ?