>Caveat: this approach only works if your application is the only one that modifies the data.
So why use it at all?
(Or is it too early in the morning for me.)
I definately would not recommend using a boolean flag to the record.
You are just opening a can of worms here.
Why not start migrating to ADO, changing your apps UI one at a time until all have neen changed?
Under DAO, you only have page locking. If you absolutly need record locking, then I would use a seperate table, even in a seperate db, and have fields to identify the table, record being locked (will need a unique key in the table being locked), user ID, and time locked.
But what if the application or system crashes? The locking information remains in the locking table, and other users still cannot edit that record even after the first user has gone home.
If the application or system crashes, then the ldb file will reflect if the user is still active or not.
So, you would need to check the ldb file, and if a user is not active anymore, turn over the record locking to the user who is attempting to place a new lock on the record.
But what if the user who was logged in before restarts? The record is even locked for them, and if this user decides not to go back to the same record, the record continues to remain locked for others, even with the above technique, because the user who originally locked the record, is active again.
When a user who locked a record, but got thrown out, because of a system crash or whatever, and logs back in, the first thing done is the locking roster table is cleared of all entries under that user's name.
You may want to consider additionally adding the workplace ID along with the user's name.
Now that this problem is solved (crashes or incorrect application/system shutdowns) you can carry on to your home made locking system under DAO a little more effectively....