I don't have the chutzpa to think I can handle it better
I've developed hundreds of Access applications (and dozens more mainframe applications) and none have ever had contention problems. Think about it. What causes a user to go to a specific record to update it? Some interaction with a customer. Is the customer going to be on the phone with two users at the same time? I doubt it.
One situation that does arise which can cause contention is a task list. In this case, I use a technique much like what Doc suggested. The task list is displayed including a field with a user name to show who is working on an item. When a user picks a task to work on, the form updates the record with his ID. Then if someone views the record, they can see who is currently working on it but they cannot update it.
To make this work, you also need a feature that lets a manager unlock a locked record.
AND unless I am implementing a task list, I allow Access to handle record locking. I don't have the chutzpa to think I can handle it betterAs you have discovered "Edited Record" extends to a block and will cause false positives. Always use optimistic locking. It is the minimum intrusion.
Yes, but your activities don't necessarily cause problems. Estimators entering different orders/quotes isn't an issue, as the optimistic process doesn't lock a block of records, or indeed any records.. It just re-reads the single record to see if a different user changed it while you were doing your own edit. (I believe the database manager process - ie access - does lock the reread for an infinitesimal duration, but that's nothing to worry about. It actually tries multiple times in case there really is an ongoing update, to allow the other micro lock to release)Thanks for your reply Pat. Whilst I take your point on the potential for record locking, in my organisation accessing same records simultaneously does happen regularly. For example part of the DB is detailed information and procedures for technical systems on sites (Site Records). So DB users can be accessing it to obtain information they might need to generate quotes, whilst another user is updating it whilst they process service records, at the same time an engineer may be ringing in to ask a user to look a certain piece of info up. It may seem unlikely but across our DB it does happen daily.
The other time it happens is when adding new quotation records to the system. At any one time at least 2/3 estimators are adding new quotes, amending existing ones etc etc simultaneously. One instance I have narrowed down is when two estimators add a new quote within minutes of each other and both have their respective records open. The block locking makes total sense in this example as almost every time, if the first user to add a quote comes out of his whilst the other person is still in the one they created and then user 1 goes back into theirs its locked, even though no one is in it. Now its obvious that both these quotes that were created within minutes of each other and are sequential in the Quotations table are likely to be in the same disk space block, hence the first is locked by the second. If you request the other user exits their quote then your quote frees up, and vice versa. Very frustrating and happens daily.
Currently I have 'Edited Record' lock turned on on each of my forms but reading this thread and the response from arnelgp it seems that the advice it to turn these locks off altogether. That said in the case of my DB that will result in user clashes with the second most user who accessed a record losing their changes?
OK, I will give it a try removing the locks.I'm having trouble visualizing a department where multiple users would be updating the same quote simultaneously. That sounds like chaos to me, but whatever.
The problem you are experiencing is caused because you have chosen the Locked Record. ALL recommendations have been to change to no locks. That could simply eliminate the problem entirely if it is always being caused by adjacent records being locked. AND, when you are adding multiple quotes at the same time, they WILL BE ADJACENT. Because new records are added immediately following existing records and so will frequently be in the same.
If you actually have people changing the exact record at the same time, I am pretty surprised but you can control it as Doc and I suggested. OR, you can show the RecordSelector and train the users to pay attention. If they open a record and someone is editing it, the circle will show.
Excellent pointIt goes back to consideration of your processes.
When you say "update an invoice details", or "update notes on a job".
Well I imagine the notes should be in a notes table, not in the jobs table. The invoice details should be in an invoice details table not in the job table
If you normalise properly you won't get clashes, as adding an invoice detail, and adding a note affects different tables, so no locked records.
You don't need to lock the job to modify a note linked to the job. You shouldn't need to update the job itself very often at all, so you are unlikely to have an update clash when updating a job.
Can you show us the fields you have in the jobs table?