validacion con un textBox
Como puedo validar los datos que introducen en un textbox, es decir, que solo me accepte numeros y que al final de que termine de teclear en el textbox, si le doy enter realiice algo?
si alguien me puede explicar, muchas gracias?
si alguien me puede explicar, muchas gracias?
Solo texto.
Private Sub descripcion_KeyPress(KeyAscii As Integer)
If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or _
(KeyAscii >= 97 And KeyAscii <= 122) Or _
KeyAscii = 164 Or KeyAscii = 165 Or KeyAscii = 13) Then
KeyAscii = 0
End If
End Sub
Y ahora al presionar Enter, es el suceso keypress
el valor del enter es 13.
Private Sub descripcion_KeyPress(KeyAscii As Integer)
If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or _
(KeyAscii >= 97 And KeyAscii <= 122) Or _
KeyAscii = 164 Or KeyAscii = 165 Or KeyAscii = 13) Then
KeyAscii = 0
End If
If KeyAscii = 13 Then
MsgBox "hola", vbCritical, "Ejemplo"
End If
Private Sub descripcion_KeyPress(KeyAscii As Integer)
If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or _
(KeyAscii >= 97 And KeyAscii <= 122) Or _
KeyAscii = 164 Or KeyAscii = 165 Or KeyAscii = 13) Then
KeyAscii = 0
End If
End Sub
Y ahora al presionar Enter, es el suceso keypress
el valor del enter es 13.
Private Sub descripcion_KeyPress(KeyAscii As Integer)
If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or _
(KeyAscii >= 97 And KeyAscii <= 122) Or _
KeyAscii = 164 Or KeyAscii = 165 Or KeyAscii = 13) Then
KeyAscii = 0
End If
If KeyAscii = 13 Then
MsgBox "hola", vbCritical, "Ejemplo"
End If
