Im really sorry but i didn't make it work completely, got excited too soon, so here it is again. Well I can validate txtAge.Text now, but im also required to then take the input and assign it to a different variable as Integer, here's what I have:
Dim ageCheck As Boolean
Dim isNum As Integer
ageCheck = IsNumeric(txtAge.Text)
isNum = Integer.Parse(txtAge.Text) "VB doesn't like this line"
If (ageCheck = False) Then
lblResults.Text = "Please correct your age"
ElseIf (isNum < 21) Then
lblResults.Text = txtName.Text & ", you are a youngster!"
ElseIf (isNum >= 21 And isNum < 40) Then
lblResults.Text = txtName.Text & ", you are an adult."
ElseIf (isNum >= 40) Then
lblResults.Text = txtName.Text & ", you are over the hill!"
End If
Dim ageCheck As Boolean
Dim isNum As Integer
ageCheck = IsNumeric(txtAge.Text)
isNum = Integer.Parse(txtAge.Text) "VB doesn't like this line"
If (ageCheck = False) Then
lblResults.Text = "Please correct your age"
ElseIf (isNum < 21) Then
lblResults.Text = txtName.Text & ", you are a youngster!"
ElseIf (isNum >= 21 And isNum < 40) Then
lblResults.Text = txtName.Text & ", you are an adult."
ElseIf (isNum >= 40) Then
lblResults.Text = txtName.Text & ", you are over the hill!"
End If
Comment