Hi
Please excuse the newbie question as I started learning VB last week . I wrote the following test code below to add two values entered in two textboxes and display it in another textbox. However I keep getting the exception.
"Conversion from string "" to type 'Decimal' is not valid"
with the code below and I cannot figure out why . I thought converting using 'CDec' resolves this issue ?
Please advise
Cheers Alfred
---
Private Sub sumTotal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sumTotal.Click
Dim total As Decimal = CDec(operand1.Text + operand2.Text)
Please excuse the newbie question as I started learning VB last week . I wrote the following test code below to add two values entered in two textboxes and display it in another textbox. However I keep getting the exception.
"Conversion from string "" to type 'Decimal' is not valid"
with the code below and I cannot figure out why . I thought converting using 'CDec' resolves this issue ?
Please advise
Cheers Alfred
---
Private Sub sumTotal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sumTotal.Click
Dim total As Decimal = CDec(operand1.Text + operand2.Text)