I am VB 2005 Student
I'm trying to validate some user input using the code provided in the textbook.
It uses "ErrMessage" as shown in the code below:
' Validate input for January
If IsNumeric(txtJan.Text) Then
Dim sngValue As Single
sngValue = CSng(txtJan.Text)
If sngValue < 0 Then
txtJan.SelectAll()
e.Cancel = True
Else
e.Cancel = False
End If
Else
ErrMessage("The input must be a number")
e.Cancel = True
End If I'm getting an Error Message saying that ErrMessage is not declared and the textbook doesn't have any details about this statement. What's wrong?
I could use MessageBox.Show("blah blah blah") but the textbook uses ErrMessage as shown above.
Gary