Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/01/2005, 04:27
Avatar de lucasiramos
lucasiramos
 
Fecha de Ingreso: agosto-2004
Ubicación: Santa Rosa, La Pampa, Argentina
Mensajes: 1.484
Antigüedad: 19 años, 9 meses
Puntos: 13
Cita:
Iniciado por RadicalEd
Código:
Sub Text1_Keypress(KeyAscii As Integer)
If KeyAscii <> Asc("9") Then
If KeyAscii <> 8 Then
KeyAscii = 0
End If
End If
End Sub
Perdon RadicalEd, ese txt solo deja ingresar 9. Yo lo haria de la siguente manera

Código:
 Private Sub Text1_KeyPress(KeyAscii As Integer)
	If KeyAscii < 48 Or KeyAscii > 57 Then
		Select Case KeyAscii
			Case 8
			Case Else
				KeyAscii = 0
		End Select
	End If
End Sub
Para las fechas te recomiendo usar un MaskedEdit o un DTPicker. Luego con respecto a la validación de texto, todo depende lo que quieras hacer...

Saludos. Lucas