ERROR 3251
Publicado por maycol (1 intervención) el 13/04/2011 10:24:13
Buen día es que estoy ejecuntando un programa en visual basic, basado en formularios con Base de datos en Access 2003.
me sale el error del titulo dice: El Recordset actual no admite actualizaciones. pUede ser una limitación del proveedor o del tipo de bloqueo seleccionado.
Option Explicit
Private Sub CmdAnterior_Click()
DeInventario.rsCmAgregar.MovePrevious
If DeInventario.rsCmAgregar.BOF Then
MsgBox "Estamos en el primer registro"
DeInventario.rsCmAgregar.MoveFirst
End If
End Sub
Private Sub CmdEditar_Click()
ModoEditar (True)
End Sub
Private Sub CmdEliminar_Click()
DeInventario.rsCmAgregar.Delete
DeInventario.rsCmAgregar.MoveNext
If DeInventario.rsCmAgregar.EOF Then
DeInventario.rsCmAgregar.MoveLast
End If
End Sub
Private Sub CmdGuardar_Click()
DeInventario.rsCmAgregar.Update
ModoEditar (False)
End Sub
Private Sub CmdNuevo_Click()
DeInventario.rsCmAgregar.AddNew
ModoEditar (True)
End Sub
Private Sub CmdPrimero_Click()
DeInventario.rsCmAgregar.MoveFirst
End Sub
Private Sub CmdSalir_Click()
Unload Me
End Sub
Private Sub CmdSiguiente_Click()
DeInventario.rsCmAgregar.MoveNext
If DeInventario.rsCmAgregar.EOF Then
MsgBox "Estamos en el ultimo registro"
DeInventario.rsCmAgregar.MoveLast
End If
End Sub
Private Sub CmdUltimo_Click()
DeInventario.rsCmAgregar.MoveLast
End Sub
Private Sub CmdVolver_Click()
tres.Hide
Dos.Show
End Sub
Private Sub ModoEditar(ByVal ok As Boolean)
txtCodigo.Locked = Not ok
txtProducto.Locked = Not ok
txtCantidad.Locked = Not ok
txtUnidad.Locked = Not ok
CmdNuevo.Enabled = Not ok
CmdGuardar.Enabled = ok
CmdPrimero.SetFocus
If ok Then txtCodigo.SetFocus
End Sub
Private Sub Form_unload(cancel As Integer)
If MsgBox("¿Desea terminar la aplicación?", vbQuestion + vbYesNo, "pregunta") = vbYes Then
End
Else
cancel = True
End Sub
me sale el error del titulo dice: El Recordset actual no admite actualizaciones. pUede ser una limitación del proveedor o del tipo de bloqueo seleccionado.
Option Explicit
Private Sub CmdAnterior_Click()
DeInventario.rsCmAgregar.MovePrevious
If DeInventario.rsCmAgregar.BOF Then
MsgBox "Estamos en el primer registro"
DeInventario.rsCmAgregar.MoveFirst
End If
End Sub
Private Sub CmdEditar_Click()
ModoEditar (True)
End Sub
Private Sub CmdEliminar_Click()
DeInventario.rsCmAgregar.Delete
DeInventario.rsCmAgregar.MoveNext
If DeInventario.rsCmAgregar.EOF Then
DeInventario.rsCmAgregar.MoveLast
End If
End Sub
Private Sub CmdGuardar_Click()
DeInventario.rsCmAgregar.Update
ModoEditar (False)
End Sub
Private Sub CmdNuevo_Click()
DeInventario.rsCmAgregar.AddNew
ModoEditar (True)
End Sub
Private Sub CmdPrimero_Click()
DeInventario.rsCmAgregar.MoveFirst
End Sub
Private Sub CmdSalir_Click()
Unload Me
End Sub
Private Sub CmdSiguiente_Click()
DeInventario.rsCmAgregar.MoveNext
If DeInventario.rsCmAgregar.EOF Then
MsgBox "Estamos en el ultimo registro"
DeInventario.rsCmAgregar.MoveLast
End If
End Sub
Private Sub CmdUltimo_Click()
DeInventario.rsCmAgregar.MoveLast
End Sub
Private Sub CmdVolver_Click()
tres.Hide
Dos.Show
End Sub
Private Sub ModoEditar(ByVal ok As Boolean)
txtCodigo.Locked = Not ok
txtProducto.Locked = Not ok
txtCantidad.Locked = Not ok
txtUnidad.Locked = Not ok
CmdNuevo.Enabled = Not ok
CmdGuardar.Enabled = ok
CmdPrimero.SetFocus
If ok Then txtCodigo.SetFocus
End Sub
Private Sub Form_unload(cancel As Integer)
If MsgBox("¿Desea terminar la aplicación?", vbQuestion + vbYesNo, "pregunta") = vbYes Then
End
Else
cancel = True
End Sub
Valora esta pregunta


0