Ver Mensaje Individual
  #5 (permalink)  
Antiguo 31/07/2011, 15:05
sielfi
 
Fecha de Ingreso: julio-2011
Mensajes: 34
Antigüedad: 12 años, 9 meses
Puntos: 0
Respuesta: Búsqueda entre 2 fechas

Hola! Gracias por responder. Me quedó así el código

Código:
Private Sub Text6_LostFocus()
 
    Dim fechaini As Date
    Dim fechatope As Date
    If Len(Trim(Text6.Text)) >= 1 Then

        If IsDate(Text6) Then
            fechaini = "16/06/2006"
            fechatope = Date
            If Text6 < fechaini Then
                MsgBox "No se puede ingresar una fecha anterior al 16/06/2006", vbInformation, "Atención"
                Text6.SetFocus
                Text6 = ""
            ElseIf Text6 > fechatope Then
                MsgBox "No se puede ingresar una fecha posterior a la de hoy", vbInformation, "Atención"
                Text6.SetFocus
                Text6 = ""
            End If
        
        Else
            MsgBox "Dato ingresado no es fecha", vbInformation, "Atención"
            Text6.SetFocus
            Text6 = ""
        End If
    Else
        Command1.SetFocus
    End If
 End Sub
Si tienen algún consejo, diganmelo. Gracias!