+ Reply to Thread
Results 1 to 3 of 3

Validate a textbox

  1. #1
    Registered User
    Join Date
    03-28-2007
    Posts
    27

    Lightbulb Validate a textbox

    Hello,

    I'm trying to validate a TexBox as a %, from 1 to 100. I suppose it's very simple but somehow i can't . My code is:

    PHP Code: 
    Private Sub CommandButton1_Click()
        
    Dim Procent As Integer
        Procent 
    TextBox1.Value
        
        
    If Procent "" Then
        MsgBox 
    "Please type in a number between 1 and 100 %"vbOKOnly vbInformation"Enter Password"
        
    ElseIf Procent 100 Then
        MsgBox 
    "Please type in a number between 1 and 100 %"vbOKOnly vbInformation"Enter Password"
        
    Else
        
    Label5.Caption TextBox1.Value
        Label7
    .Visible True
        TextBox1
    .Value ""
        
    End If
    End Sub 
    Here it gives me an error on Procent = TextBox1.Value. How can I validate only numbers between 1 and 100 to be in the TextBox?

  2. #2
    Forum Contributor
    Join Date
    12-12-2005
    Posts
    667
    You must treat it as a value:
    Please Login or Register  to view this content.
    Best regards,

    Ray

  3. #3
    Registered User
    Join Date
    03-28-2007
    Posts
    27
    Thanks, it works . I'm a newbie in programming and sometimes i cannot get in mind so simple things

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1