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?