Ver Mensaje Individual
  #6 (permalink)  
Antiguo 23/11/2010, 10:13
gohanjaja
 
Fecha de Ingreso: junio-2008
Mensajes: 58
Antigüedad: 15 años, 11 meses
Puntos: 0
Respuesta: Hola, como puedo validar un textbox con númeres entre xx hasta xxx

Código:
Private Sub doc_KeyPress(KeyAscii As Integer)                        'DOCUMENTO

If KeyAscii = vbKeyReturn Then
    KeyAscii = 0
        
    Dim d1 As Long, x As Integer
    
d1 = Val(doc.Text)
        If d1 = 0 Then
            x = MsgBox("Ingrese Solo Digitos Numericos", vbCritical, "Error D.N.I.")
            doc.Text = ""
        
        Else
                    
                If (d1 > 5000000) And (d1 < 50000000) Then
                    Call Form_lostfocus
                
                
                Else
                    x = MsgBox("Ingrese Dentro Del Rango Permitido" + Chr(10) + "Mayor a 5.000.000 y Menor 50.000.000", vbCritical, "Error D.N.I.")
                    doc.Text = ""
                End If
        End If

        
    
End If

numeros = "0123456789," & vbBack
 num = Chr(KeyAscii)
 V = InStr(1, numeros, num)
 If V = 0 Then
    KeyAscii = 0
    
 End If
        
End Sub
Encontre ése en un trabajo viejo , anda bien , pero no trabaja con ADO recorset... intente probar y me tira errores por todos lados...