It's been awhile since I've worked with VB, but if you're trying to adjust the value like that immediately when a box is checked/unchecked, you need to call the checkbox's CheckChanged event:
(note, the syntax may be a little off.. it's been years since I've touched VB, so this is coming off the top of my head)
Edit:Code:Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged If (CheckBox1.Checked = True) Then additionalCharges = additionalCharges + 25 Else additionalCharges = additionalCharges - 25 End If End Sub
Generally I would have all the entry fields call an Update function that I write, then do all my work in the Update function to check all checkboxes/optionbuttons/values to calculate results. That way, you just have to call this Update function in the CheckChanged-type event for all objects that can be changed.
Connect With Us