I have 2 textboxes, one where I can enter a value and the "£" character is inside the textbox and in the second textbox it retrievs a value in the same format with the "£" character from mysql table which needs to be added to the first value.
What happens is when I enter values in the first textbox it doesn't get added to the second textbox, they both just stay the same. Can't see what is wrong with my code:
Private Sub txtsurcharges_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtsurcharges.TextChanged
Dim c As Integer
c = Val(txtsurcharges.Text) + Val(txttotal.Text)
txttotal.Text = c
End Sub
Valit does work like it used to in QBx-VB6. If you are displaying currency, saving to Integer will loose the decimal part, use a Decimal or Double variable. Since these appear to be user input, useDecimal.TryParseto get the values.