Input box Validation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • smokey786b21
    New Member
    • Mar 2007
    • 2

    Input box Validation

    how can i validate a inputbox, i need it so that the user can only put numbers like, 10, 20 30 etc. the input box will input the data into a textbox. can some one help me pleasE?
  • mabubakarpk
    New Member
    • Feb 2007
    • 62

    #2
    You can do validation such

    Code:
              Dim sInput As Variant
        
    Label_Check_Validation:
    
        sInput = InputBox("Enter Value", "Value")
        If IsNumeric(sInput) = False Then
            GoTo Label_Check_Validation
        Else
            'what u want to do next
        End If

    Comment

    • smokey786b21
      New Member
      • Mar 2007
      • 2

      #3
      thanks ill try that out :)

      Comment

      • rajaaryan44
        New Member
        • Mar 2007
        • 11

        #4
        text1 is the textbox just put this code in the textbox key press event . u will get the result

        Private Sub Text1_KeyPress( Index As Integer, KeyAscii As Integer)
        If Not ((KeyAscii >= 47 And KeyAscii <= 57) Or KeyAscii = 8) Then
        Beep
        KeyAscii = 0
        Else
        KeyAscii = Asc(UCase(Chr(K eyAscii)))
        End If
        End Sub

        Comment

        • devonknows
          New Member
          • Nov 2006
          • 137

          #5
          Originally posted by smokey786b21
          how can i validate a inputbox, i need it so that the user can only put numbers like, 10, 20 30 etc. the input box will input the data into a textbox. can some one help me pleasE?
          Just to point out that the same conversation was going on a few posts earlier, heres the link



          *Hint, when using the search function use specific words, like Numeric, Text box

          If the above posts dont help, then maybe this other discussion will do

          Kind Regards.
          Devon.

          Comment

          Working...