error en este codigo fuente ayudemen porfavor
Publicado por eddy (3 intervenciones) el 26/04/2004 18:49:13
Estoy desarrollando una pequeño programa que es tarea para mi clase de programación donde la BD esta hecha con Access 2000 pero al momento de mandar a Guardar esta me devuelve el siguiente mensaje:LA CEDULA YA EXISTE, donde la BD esta totalmente vacia alguien podria ayudarme a corregir este error muchas Gracias de Antemano.
El codigo fuente es este de abajo:
Private Sub guarda_Click()
On Error Resume Next
If valor <> 1 Then
With Data1.Recordset
!CI = Txtcedula
!Apellidos = Txtapellido
!Nombres = Txtnombrep
!NombreCurso = Txtnombrec
!Lugar = Txtlugar
!Fecha = Txtfecha
.Udate
If Err.Number = "3022" Then
.CancelUdate
MsgBox ("La Cédula a Insertar ya Existe"), vbCritical, "En el Sitema de Control de Registro"
limpiar
Exit Sub
Else
MsgBox (" La Cédula ya fue Registrada"), vbInformation, "GUARDANDO SISTEMA DE CONTROL DE REGISTRO SATEM"
limpiar
End If
End With
Else
With Data1.Recordset
!CI = Txtcedula
!Apellidos = Txtapellido
!Nombres = Txtnombrep
!NombreCurso = Txtnombrec
!Lugar = Txtlugar
!Fecha = Txtfecha
.Udate
MsgBox ("Los Datos ya fueron Modificados y Actualizados"), vbInformation, "SISTEMA DE CONTROL DE REGISTRO SATEM"
limpiar
End With
End If
End Sub
El codigo fuente es este de abajo:
Private Sub guarda_Click()
On Error Resume Next
If valor <> 1 Then
With Data1.Recordset
!CI = Txtcedula
!Apellidos = Txtapellido
!Nombres = Txtnombrep
!NombreCurso = Txtnombrec
!Lugar = Txtlugar
!Fecha = Txtfecha
.Udate
If Err.Number = "3022" Then
.CancelUdate
MsgBox ("La Cédula a Insertar ya Existe"), vbCritical, "En el Sitema de Control de Registro"
limpiar
Exit Sub
Else
MsgBox (" La Cédula ya fue Registrada"), vbInformation, "GUARDANDO SISTEMA DE CONTROL DE REGISTRO SATEM"
limpiar
End If
End With
Else
With Data1.Recordset
!CI = Txtcedula
!Apellidos = Txtapellido
!Nombres = Txtnombrep
!NombreCurso = Txtnombrec
!Lugar = Txtlugar
!Fecha = Txtfecha
.Udate
MsgBox ("Los Datos ya fueron Modificados y Actualizados"), vbInformation, "SISTEMA DE CONTROL DE REGISTRO SATEM"
limpiar
End With
End If
End Sub
Valora esta pregunta


0