Over the last few years I’ve run into many customers with record locking issues.  Given the scenario of a shared multi-user database with the backend stored in SQL or another Access database, you risk two users simultaneously editing the same record.  You may have a form which presents a list of data, or a form with several bound data fields that users frequently edit.  So what happens when one user opens it and starts to modify the data, and then the other user also opens the same record?  The last user to write their changes wins.  So theoretically data could be lost (and frequently is!).

In SQL there are settings you can make to handle this better, but they are not always appropriate or more efficient (read about pessimistic vs optimistic locking).  However – there is another way:

Build a table to store user record editing
Upon edit of a record, write appropriate data to the table
After cancel or update, remove the record lock data
Plan for administration of the lock table in the event of network connection loss other unexpected happenings.

I wrote this code finally this week….integrated it into a Access front end on a SQL backend with more than 50 users.  It took some debugging to handle it properly, but we now have success!  It automatically displays a message when a user is editing a record if someone else also tries to simultaneously edit that record.  It then removes the message and lets you edit immediately upon the lock being removed, along with correctly showing the current data after other users modification.  NO messages to click, and no slow code.  No more lost data!

If you want a copy of this code, contact us and request it, I’ll send you a copy for free!

Jeff Shirley

Jeff Shirley

Founder & CEO
Jeff brings over 27 years of experience to the table, along with numerous awards, certifications, and real-world implementations.  His database solutions are currently running in industries including government, mining, agriculture, finance, education, science, research, non-profits, and healthcare businesses around North America and serve thousands of users day to day.  Jeff is a five-time MVP Award recipient for Microsoft Access, acknowledging contributions to community projects, evangelism, and educational outreach on Microsoft technologies.  Today there are less than 50 Access MVP’s worldwide. While Jeff focuses day to day on business management, IoT development, IT integrations and design, database architecture or other typical complex tasks, he also is a co-owner of Blue Heron Gardens, a commercial apiary running over 200 beehives.  Fresh honey is a small perk for many of our clients!

Mitch Redekopp

Partner
Mitch works with our clients day to day ensuring web development and IT projects are done to exceed customer expectations.  His background includes formal training in IT, Microsoft and CompTIA certifications, real-world business experience, and a true dedication to ensuring clients receive timely and professional support on their projects with Rivercity Technology Services.  Given the most difficult requests for IT solutions, Mitchell can assist our clients in finding a path to the best options which deliver results for our clients.  Mitchell is an avid soccer player and Manchester City fan, be sure to talk soccer with him when you can.