• Jueves 25 de Abril de 2024, 00:48

Autor Tema:  [SOLUCIONADO] Error 3021 No Hay Ningun Registro Activo  (Leído 17132 veces)

korsakof

  • Miembro activo
  • **
  • Mensajes: 36
  • Nacionalidad: es
    • Ver Perfil
[SOLUCIONADO] Error 3021 No Hay Ningun Registro Activo
« en: Miércoles 25 de Febrero de 2009, 20:11 »
0
Ola buenas, perdonad.
Me aprece un mensaje que no entiendo porque cuando voy a realizar una busqueda de un registro en access.

Lo que aparece es eso: Error 3021 No Hay Ningun Registro Activo

No consigo entender el porque.

Muchas gracias de nuevo.
« última modificación: Jueves 26 de Febrero de 2009, 18:09 por korsakof »

m0skit0

  • Miembro de PLATA
  • *****
  • Mensajes: 2337
  • Nacionalidad: ma
    • Ver Perfil
    • http://fr33kk0mpu73r.blogspot.com/
Re: Error 3021 No Hay Ningun Registro Activo
« Respuesta #1 en: Jueves 26 de Febrero de 2009, 03:35 »
0
¿Puedes poner una parte relevante del código que te genera este error?

Salud

korsakof

  • Miembro activo
  • **
  • Mensajes: 36
  • Nacionalidad: es
    • Ver Perfil
Re: Error 3021 No Hay Ningun Registro Activo
« Respuesta #2 en: Jueves 26 de Febrero de 2009, 17:27 »
0
Este es el codigo de la busqueda.

Código: Visual Basic
  1.  
  2. Private Sub txtcodpaciente_LostFocus()
  3.     Dim criterio As String
  4.     Dim v As Integer
  5.    
  6.     v = Val(txtcodpaciente.Text)
  7.  
  8.     If txtcodpaciente.Text <> "" And v >= 1 And v <= 99999 Then
  9.         criterio = "codpHIS = " & Val(txtcodpaciente.Text)
  10.        
  11.         registrohispacientes.FindFirst criterio
  12.        
  13.         If registrohispacientes.NoMatch Then
  14.             txtcodpaciente.Text = registrohispacientes.Fields("codpHIS")
  15.             txtnumcorre.Text = registrohispacientes.Fields("cohHIS")
  16.             txtcodenfermedad.Text = registrohispacientes.Fields("codeHIS")
  17.             txtcodmedico.Text = registrohispacientes.Fields("codmHIS")
  18.             txtcodtratamiento.Text = registrohispacientes.Fields("codtHIS")
  19.             txtfechahistorial.Text = registrohispacientes.Fields("fechaHIS")
  20.             txtnotashistorial.Text = registrohispacientes.Fields("notaHIS")
  21.             tbarhispacientes.Buttons(1).Enabled = False
  22.             tbarhispacientes.Buttons(2).Enabled = True
  23.             tbarhispacientes.Buttons(3).Enabled = True
  24.         Else
  25.             tbarhispacientes.Buttons(1).Enabled = True
  26.             tbarhispacientes.Buttons(2).Enabled = False
  27.             tbarhispacientes.Buttons(3).Enabled = False
  28.    
  29.     End If
  30. End If
  31. End Sub
  32.  
  33.  
  34.  

Gracias.

korsakof

  • Miembro activo
  • **
  • Mensajes: 36
  • Nacionalidad: es
    • Ver Perfil
Re: Error 3021 No Hay Ningun Registro Activo
« Respuesta #3 en: Jueves 26 de Febrero de 2009, 18:08 »
0
Solucionado


Código: Visual Basic
  1. # Private Sub txtcodpaciente_LostFocus()
  2. #     Dim criterio As String
  3. #     Dim v As Integer
  4. #    
  5. #     v = Val(txtcodpaciente.Text)
  6. #  
  7. if not registrohispacientes.eof then
  8.  
  9. #     If txtcodpaciente.Text <> "" And v >= 1 And v <= 99999 Then
  10. #         criterio = "codpHIS = " & Val(txtcodpaciente.Text)
  11. #        
  12. #         registrohispacientes.FindFirst criterio
  13. #        
  14. #         If registrohispacientes.NoMatch Then
  15. #             txtcodpaciente.Text = registrohispacientes.Fields("codpHIS")
  16. #             txtnumcorre.Text = registrohispacientes.Fields("cohHIS")
  17. #             txtcodenfermedad.Text = registrohispacientes.Fields("codeHIS")
  18. #             txtcodmedico.Text = registrohispacientes.Fields("codmHIS")
  19. #             txtcodtratamiento.Text = registrohispacientes.Fields("codtHIS")
  20. #             txtfechahistorial.Text = registrohispacientes.Fields("fechaHIS")
  21. #             txtnotashistorial.Text = registrohispacientes.Fields("notaHIS")
  22. #             tbarhispacientes.Buttons(1).Enabled = False
  23. #             tbarhispacientes.Buttons(2).Enabled = True
  24. #             tbarhispacientes.Buttons(3).Enabled = True
  25. #         Else
  26. #             tbarhispacientes.Buttons(1).Enabled = True
  27. #             tbarhispacientes.Buttons(2).Enabled = False
  28. #             tbarhispacientes.Buttons(3).Enabled = False
  29. #    
  30. #     End If
  31. # End If
  32. else
  33.     rem botones. Dependera del proyecto
  34.    x=msgbox("No hay registros",vbokonly,"Clinica")
  35. end if
  36. # End Sub
  37. #  
  38. #  
  39.