problema urgente
Publicado por manuel (51 intervenciones) el 19/08/2008 22:41:36
hola a todos resulta que tengo el siguiente dilema partiendo de capturar el error 3022 actualizar la clave esto en un subform vinculado al form principal como veran logro grabar en la tabla mas no puedo hacer que el formulario se refresque con el nuevo registro usando "Me.[permisos subformulario].Form.RecordSource = "select * from permisos where id=" & ID & " and Format(FECDOC,'yyyymm')=" & Me.Parent.SEL " lo que me da errores .... por favor agradeceria cualquier ayuda que me puedan dar
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Dim rw As DAO.Recordset
If DataErr = 3022 Then
Response = acDataErrAdded 'acDataErrContinue
Set rw = CurrentDb.OpenRecordset("permisos", dbOpenDynaset)
rw.AddNew
rw!TIPDOC = Me.TIPDOC
rw!NUMDOC = Contador.Counter
rw!ID = Me.ID
rw!FECDOC = Me.FECDOC
rw!HORINI = Me.HORINI
rw!HORFIN = Me.HORFIN
rw!STATUS = Me.STATUS
rw!AUDITOR = CurrentUser() & " " & Mid(Usuario, 1, Len(Usuario) - 1) & " " & Ordenador & " " & Now()
rw.Update
rw.Close
Set rw = Nothing
Me.[permisos subformulario].Form.RecordSource = "select * from permisos where id=" & ID & " and Format(FECDOC,'yyyymm')=" & Me.Parent.SEL
End If
End Sub
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Dim rw As DAO.Recordset
If DataErr = 3022 Then
Response = acDataErrAdded 'acDataErrContinue
Set rw = CurrentDb.OpenRecordset("permisos", dbOpenDynaset)
rw.AddNew
rw!TIPDOC = Me.TIPDOC
rw!NUMDOC = Contador.Counter
rw!ID = Me.ID
rw!FECDOC = Me.FECDOC
rw!HORINI = Me.HORINI
rw!HORFIN = Me.HORFIN
rw!STATUS = Me.STATUS
rw!AUDITOR = CurrentUser() & " " & Mid(Usuario, 1, Len(Usuario) - 1) & " " & Ordenador & " " & Now()
rw.Update
rw.Close
Set rw = Nothing
Me.[permisos subformulario].Form.RecordSource = "select * from permisos where id=" & ID & " and Format(FECDOC,'yyyymm')=" & Me.Parent.SEL
End If
End Sub
Valora esta pregunta


0