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?
Input box Validation
Collapse
X
-
Tags: None
-
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
-
-
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 SubComment
-
Originally posted by smokey786b21how 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?
*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
Comment