Lockedits problem

A

Art

I am trying to update a records in a recordset and as I loop through the
records, I want to check whether the record has been locked by another user,
using pessimistic locking.

In another instance of the database, I edit the record, but do not save ---
then I run this code. It's supposed to raise an error on the update
statment, but does not. Any thoughts?

set db = currentdb
set rs = db.openrecordset ("table1")
do until rs.eof
on error goto handle_error
rs.lockedits = true
rs.edit
rs!field1 = "test"
rs.update
nrecord:
rs.movenext
loop

handler_error:
x = x + 1
resume nrecord


Thanks in advance for your help
 

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