Hi,
I have two codes;
which when I change the value of the value from Full Pay to No Pay in the cmbpaystatus -
I receive InvalidCastException was unhandled.
Conversion from string "" to type 'Double' is not valid.
Thanks
I have two codes;
which when I change the value of the value from Full Pay to No Pay in the cmbpaystatus -
I receive InvalidCastException was unhandled.
Conversion from string "" to type 'Double' is not valid.
Code:
Private Sub txtamt_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtamt.TextChanged
Dim tot As Integer = 0
tot += TxtSubTotal.Text - txtamt.Text
txtBal.Text = tot.ToString("#,0.00")
If txtBal.Text = "0.00" Then
cmbpaystatus.Text = "Full Pay"
End If
End SubCode:
Private Sub cmbpaystatus_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbpaystatus.SelectedIndexChanged
Dim tot As Integer = 0
If cmbpaystatus.Text = "Full Pay" Then
txtamt.Text = TxtSubTotal.Text
txtamt.Enabled = False
End If
If cmbpaystatus.Text = "No Pay" Then
txtamt.Clear()
txtamt.Text = ToString("#,0.00")
End If
If cmbpaystatus.Text = "Part Pay" Then
txtamt.Clear()
txtamt.Enabled = True
End If
End Sub