Validation function

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2005
Posts: 35
Reputation: k_en is an unknown quantity at this point 
Solved Threads: 0
k_en k_en is offline Offline
Light Poster

Validation function

 
0
  #1
May 2nd, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 75
Reputation: purplegerbil is an unknown quantity at this point 
Solved Threads: 6
purplegerbil's Avatar
purplegerbil purplegerbil is offline Offline
Junior Poster in Training

Re: Validation function

 
0
  #2
May 2nd, 2006
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Private Sub Command1_Click()
  2.  
  3. If IsNumeric(Text1.Text) = False Then
  4. MsgBox "Is not an integer"
  5. Exit Sub
  6. End If
  7.  
  8. MsgBox "Ok"
  9.  
  10. End Sub



pG
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC