RoccoSiffredi
Technical User
Hi All
The following VBA adds an integer to another integer, if a value is entered in the textbox. If the user does not enter a value in the box i.e. it is left blank and the User Change button is clicked the VBA freezes - I'm using Visual Basic Express. What statement do I need to enter to enter in this sub to prevent crashing?
Private Sub btnUChange_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUChange.Click
Dim AddNum As Integer
AddNum = txtInput.Text
NumberValue = NumberValue + AddNum
lblOutput.Text = "The Number Value has a Value of " & NumberValue
End Sub
The following VBA adds an integer to another integer, if a value is entered in the textbox. If the user does not enter a value in the box i.e. it is left blank and the User Change button is clicked the VBA freezes - I'm using Visual Basic Express. What statement do I need to enter to enter in this sub to prevent crashing?
Private Sub btnUChange_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUChange.Click
Dim AddNum As Integer
AddNum = txtInput.Text
NumberValue = NumberValue + AddNum
lblOutput.Text = "The Number Value has a Value of " & NumberValue
End Sub