954,180 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Validation function

i have created a textbox, and if the user have enter an invalid value, the textbox must be able to check whether the value enter by the user is a string or an integer. I have set the CausesValidation to true. If i tried to enter a character, and the msgbox should appear "Is not an integer" but instead i got an error message that says "compile error : Method or data member not found " . I doesn't understand why does this error message keep pop out. Please explain where it went wrong.

Private Sub Text2_Validate(Index As Integer, Cancel As Boolean)

    If IsNumeric(Text2.Text) = False Then
        MsgBox "Is not an integer"
        Cancel = True
        
    End If

End Sub
k_en
Light Poster
35 posts since Jul 2005
Reputation Points: 13
Solved Threads: 0
 
Private Sub Command1_Click()

    If IsNumeric(Text1.Text) = False Then
        MsgBox "Is not an integer"
        Exit Sub
    End If

    MsgBox "Ok"

End Sub


pG

purplegerbil
Junior Poster in Training
78 posts since Apr 2005
Reputation Points: 24
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You