ordenar un adodc1.refresh....ya prove lo que me enviaron...envio el codigo...
Private Sub buscar_Click()
On Error GoTo manejador
textos frmencargado, False
Dim Clave As String
cn.ConnectionTimeout = 100
cn.Open "inventario", "", ""
Clave = InputBox("Introduzca el numero del encargado a buscar", " BUSCAR ENCARGADO", "Escriba aquí")
bus = "select * from encargado where eccvec ='" & Clave & "'"
Set rst = cn.Execute(bus)
adodc1.RecordSource = "Select * from encargado Order By ecnuec
Adodc1.Refresh
Do While Not Adodc1.Recordset.EOF
If Adodc1.Recordset!eccvec = Clave Then
enc = 1
Exit Do
Else
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
MsgBox ("Registro no existe")
enc = 0
End If
End If
Loop
'Set rs2 = cn.Execute(bus2)
If enc = 1 Then
While Not rst.EOF
Text1.Text = rst!eccvec
Text2.Text = rst!ecnoec
Text3.Text = rst!ecnusr
rst.MoveNext
Wend
Else
Adodc1.Refresh
End If
Set rst = Nothing
Set cn = Nothing
Exit Sub
manejador:
MsgBox (Err.Description)
End Sub
On Error GoTo manejador
textos frmencargado, False
Dim Clave As String
cn.ConnectionTimeout = 100
cn.Open "inventario", "", ""
Clave = InputBox("Introduzca el numero del encargado a buscar", " BUSCAR ENCARGADO", "Escriba aquí")
bus = "select * from encargado where eccvec ='" & Clave & "'"
Set rst = cn.Execute(bus)
adodc1.RecordSource = "Select * from encargado Order By ecnuec
Adodc1.Refresh
Do While Not Adodc1.Recordset.EOF
If Adodc1.Recordset!eccvec = Clave Then
enc = 1
Exit Do
Else
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF Then
MsgBox ("Registro no existe")
enc = 0
End If
End If
Loop
'Set rs2 = cn.Execute(bus2)
If enc = 1 Then
While Not rst.EOF
Text1.Text = rst!eccvec
Text2.Text = rst!ecnoec
Text3.Text = rst!ecnusr
rst.MoveNext
Wend
Else
Adodc1.Refresh
End If
Set rst = Nothing
Set cn = Nothing
Exit Sub
manejador:
MsgBox (Err.Description)
End Sub
adodc1.RecordSource = "Select * from encargado Order By ecnuec
Te falta cerrar esas comillas. prueba... Suerte
Te falta cerrar esas comillas. prueba... Suerte