Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to automate RecordLocksin Access 2007?

Status
Not open for further replies.

MacroScope

Programmer
Jul 17, 2010
286
US
I have a small, split, SQL database with about 14 users. I had a problem with people trying to access a record that was in use by someone else. There are many commands that run OnCurrent, and as soon as the new entrant hit the record (whose RecordLocks status was set to "Edited Record"), there would be error messages (Can't Set Value). Since I could find no solutions online, I created my own solution to stopping the error messages and identifying which user had the record open, which I posted separately at
It works almost perfectly, but there is one slight problem with it. Everything is stopped as soon as the record is hit, so apparently Access never sees the record as being locked until you try to save a change. If a user ignores the message which tells them that someone else is in the record they can still make changes, but then they are hit with a clipboard error when they try to leave or save.

What I thought was a simple solution was to automate the Record Locks function of the form, so that as soon as the record was identified as being in use by someone else, the Record Locks would change to "Read Only", and when they moved to another unused record the Record Locks would return to the "Edited Record" status.

That would have solved the problem, except for one minor detail. Apparently Record Locks is not a function that can be manipulated programatically. Does anyone know how to:
a) manipulate Record Locks programatically, or
b) solve this problem using another method?

Suggestions will be greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top