MacroScope
Programmer
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.
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.