RoccoSiffredi
Technical User
I have vba to compare values entered in a textbox.
The code validates (Visual Basic 2010 Express) but hangs when I run it and enter a non numerical value in the TxtInputDays box.
If Not (IsNumeric(TxtInputDays)) Then
MessageBox.Show("Please enter a numerical value")
ElseIf result1 > (TodaysRate * myvar) Then
LblResult.Text = "you will be better off by £" & diff & " if you go with option 1"
ElseIf LblResult.Text = "you will be worse off by £" & -diff & " if you go with option 2" Then
End If
If I remove the first part of the validation and leave :
If result1 > (TodaysRate * myvar) Then
LblResult.Text = "you will make more money by £" & diff & " if you go with option 1"
ElseIf LblResult.Text = "you will make more money by £" & -diff & " if you go with option 2" Then
End If
End Sub
The code doesn't hang.
The code validates (Visual Basic 2010 Express) but hangs when I run it and enter a non numerical value in the TxtInputDays box.
If Not (IsNumeric(TxtInputDays)) Then
MessageBox.Show("Please enter a numerical value")
ElseIf result1 > (TodaysRate * myvar) Then
LblResult.Text = "you will be better off by £" & diff & " if you go with option 1"
ElseIf LblResult.Text = "you will be worse off by £" & -diff & " if you go with option 2" Then
End If
If I remove the first part of the validation and leave :
If result1 > (TodaysRate * myvar) Then
LblResult.Text = "you will make more money by £" & diff & " if you go with option 1"
ElseIf LblResult.Text = "you will make more money by £" & -diff & " if you go with option 2" Then
End If
End Sub
The code doesn't hang.