RSS Forums RSS
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 1340 | Replies: 1
Reply
Join Date: Jul 2005
Posts: 35
Reputation: k_en is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
k_en k_en is offline Offline
Light Poster

Validation function

  #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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2005
Location: West Yorkshire, England
Posts: 72
Reputation: purplegerbil is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
purplegerbil's Avatar
purplegerbil purplegerbil is offline Offline
Junior Poster in Training

Re: Validation function

  #2  
May 2nd, 2006
Private Sub Command1_Click()

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

    MsgBox "Ok"

End Sub



pG
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 7:16 pm.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC