Run-time Error 3188 Help

K

kMan

I'm getting this weird error. Does anyone know what this is?
Runtime Error 3188. Could not update; currenlty locked by another session on
this machine.

This is situation in which this happens:

I have a subform in a mainform that contains records. when the user clicks
"modify" this subform's fields are modifiable. One of the field is selection
of oen-to-many relationships (eg. one customer-to-many items). When the user
double clicks on this field, a pop-up menu opens, passing the value of the
primekey as a openarg.

I make query to auto select existing entries, and let user add or remove
from this selection in a list box. when the user hits ok, I hide the box and
when the code resumes (called form with acDialog option), I update the table
containing the many relationships.

Following this I update the parent (although no relationships are enforced
in Access through the relationship manager) table and get this error.

Please help, I;m desperate. Thanks
 
M

Michel Walsh

It sounds that a form make a modification to the 'actual' record (probably
modifying the value of one of its control bound to a table), THEN you open
another form which will try, somehow, to modify the same record (probably
from a batch of modifications, with the batch covering the record already
modified, but not yet saved, of the first form). If so, possible solutions
are to have the batch of modifications, from the second form, explicitly
skip the record of the first form, or, simpler, to UNDO or SAVE the record,
in the first form, BEFORE calling the second form that will run the batch of
modifications.



Hoping it may help,
Vanderghast, Access MVP
 
K

kMan

Sorry I should have made it clear, the second form modifies a separate table
using the primekey of the firsttable as a condition. Ie primekey of the first
table is the foreign key of the second table being modified in the second
table.

But the problem I have found, after couple of shots of scotch, was that I
was "locking" the record the user wants to modify by doing the following: I
reassign the recordsource of the firstform with the usual "SELECT * from
tblFirst", but with a where condition attached. "WHERE tblFirst.PrimeKey = "
& modifiedPrimeKey

This restricts records in the form to the one being modified. I'm doing this
after users (ie myself) complained that scroll wheel takes you to another
record to the one being modified accidently.

Access seems to lock this record when I do this. To overcome this, I delete
the WHERE condition just prior to update, and then perform update after.
Seems to work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top