Getting error: Could not update: Currently this element is locked using ado transaction in VBA (1 Viewer)

pacctono

Member
Local time
Today, 01:35
Joined
Jun 13, 2022
Messages
64
Hello!

First, I do not know if that is the error in english. I am getting "No se pudo actualizar actualmente este elemento está bloqueado".
errorObjetoBloqueado.PNG

I am trying to do an ado transaction that contains several query, basically UPDATE's and INSERT's using a form (in the image, beside the error popup window) in VBA. I am working with a local table (lo_prestamos) in the form (where I can change 4 fields, only), my first sql command is an UPDATE, where I am getting the error, that updates the BE table with the four (4) fields in the FE table, like this:

<code>
UPDATE ap_prestamos_pendientes AS t INNER JOIN lo_prestamos AS l ON (t.au_control = l.au_control)
SET t.fe_depositado = l.fe_depositado, t.tx_banco_referencia = l.tx_banco_referencia, t.tx_cuenta = l.tx_cuenta, t.tx_observacion = l.tx_observacion;
</code>

The error occurs, only when I change any of the fileds in the form. If I close the error windows or close and open the form without changing any field, the query works as they should, as in the following image:
errorPasoSiNomodifico.PNG

Does anybody can give me a help, please?

I have read that this occurs when doing an pesimistic lock, but I do not get it.
 

Attachments

  • errorObjetoBloqueado.PNG
    errorObjetoBloqueado.PNG
    19.2 KB · Views: 75
  • errorPasoSiNomodifico.PNG
    errorPasoSiNomodifico.PNG
    23.4 KB · Views: 62

pacctono

Member
Local time
Today, 01:35
Joined
Jun 13, 2022
Messages
64
I solved my problem. I went aroud it. If somebody else have another solution I will appreciate it.

My first command was an UPDATE, that was using the table that is the source of the form. name it "local". I am updating a different table (name it "pendiente") but I think access does not like that so I create a recordset with a query that return all rows from "local", loop thru them and UPDATE each row of "pendiente".
 

Ranman256

Well-known member
Local time
Today, 01:35
Joined
Apr 9, 2015
Messages
4,337
If you are in access, there's no reason to run an ADO event.
 

Users who are viewing this thread

Top Bottom