Private Sub buscar_Click()
Dim buscado As String, criterio As String
If Option1.Value = False And Option2.Value = False And Option3.Value = False Then
Mensaje = MsgBox("SELECCIONA UNA OPCION DE BUSQUEDA", vbCritical, "SELECCIONAR OPCION")
Else
If Option1.Value = True Then
buscado = InputBox("¿CEDULA DEL DOCENTE:?")
If buscado = "" Then Exit Sub
criterio = "CEDULA like '*" & buscado & "*'"
Adodc1.Recordset.MoveNext
If Not Adodc1.Recordset.EOF Then
Adodc1.Recordset.Find criterio
End If
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find criterio
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveLast
MsgBox ("CEDULA NO ENCONTRADA")
End If
End If
Else
If Option2.Value = True Then
buscado = InputBox("¿NOMBRES DEL DOCENTE:?")
If buscado = "" Then Exit Sub
criterio = "NOMBRES like '*" & buscado & "*'"
Adodc1.Recordset.MoveNext
If Not Adodc1.Recordset.EOF Then
Adodc1.Recordset.Find criterio
End If
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find criterio
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveLast
MsgBox ("NOMBRE NO ENCONTRADO")
End If
End If
Else
buscado = InputBox("¿APELLIDOS DEL DOCENTE:?")
If buscado = "" Then Exit Sub
criterio = "APELLIDOS like '*" & buscado & "*'"
Adodc1.Recordset.MoveNext
If Not Adodc1.Recordset.EOF Then
Adodc1.Recordset.Find criterio
End If
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find criterio
If Adodc1.Recordset.EOF Then
Adodc1.Recordset.MoveLast
MsgBox ("APELLIDO NO ENCONTRADO")
End If
End If
End If
End If
End If
End Sub
No hay comentarios:
Publicar un comentario
No dejes de comentar!!!