2

I have a form bound to a table with a long text field (form_conversationDetail).

I can add and then edit and save the same record until the number of characters in the field goes over 2000.

After that, I start getting the following when I attempt to save the record:

Error 3188: Could not update; currently locked by another session on this machine.

I have a parent form (form_conversations) that provides a list of records that allow the user to choose which conversation to edit in form_conversationDetail.

Before opening form_conversationDetail, I tried setting Dirty to False.

Ashwin Nirmul
  • 61
  • 1
  • 8

2 Answers2

3

I added the following statement right before I save which seems to have resolved the situation:

DBEngine.Idle dbFreeLocks
Andre
  • 26,751
  • 7
  • 36
  • 80
Ashwin Nirmul
  • 61
  • 1
  • 8
  • May depend on settings. Didn't need that on >10000 chars (created with String(15000, "a") most time, only 2-3 on 100 updates inserts, no rich-text – ComputerVersteher Feb 05 '20 at 18:19
  • If this is the solution please click the green check mark to close the question. – HackSlash Sep 14 '21 at 18:15
  • 1
    Solution by @AlbertD.Kallal on another post is to use a Me.Refresh of the form that called the popup form. Worked for me. I tried the solution above and other workarounds but none of them worked; but doing a Me.Refresh of the calling form before doing the Me.Dirty = False to save the record on the popup form solved the 3188 error. Interestingly, though, it is only for Rich Text textboxes that have a Len of more than 2000 characters that requires the Me.Refresh to be done--if the textbox has a Len of less than 2000 characters, I get no errors when trying to save out the record. Strange! – DRC Sep 29 '22 at 00:19
0

I have an Access database with a table called "Post" and a field called "body" which was long text RTF. I was constantly getting:

Could not update; currently locked by another session on this machine

To reproduce

  1. Create a table called Post with a long test field of type RFT.
  2. Create two separate forms that access Post.Body
  3. Open one form, and add more than 2000 characters (not sure about the threshold, but only occurs with large data) to Post.Body. Navigate to a different record and then back
  4. Open a second form that displays Post.Body
  5. Navigate both forms to the same record with the long text. Try editing the text and then saving (navigating to another record)

Observed

  1. "Could not update; currently locked by another session on this machine"
  2. Have to restart Access to fix.

Other Scenarios

  1. The same issue happens if there is a form and a report that both have the RFT control and they point to the same record, and you try to edit the text in the form.
  2. If the second form edits the same record, but does not have the RTF control, there is no problem.
  3. If the report points to the same record, but does not have the RTF control, there is no problem.
  4. I tried with the forms both in the same database as the tables as well as with the table linked from another database, and the same problem.
  5. I tried the various lock options under "Options" and had the same problem.

Conclusion

This seems like a Microsoft Access bug. The fact that a report, which can't even edit the data and should be doing a non-locking read causes the issues, suggests it's a bug.

Fix

I have to make sure no one opens a second screen that views the same record with the RTF control while someone is editing the RTF value.

I tried refresh and other possible fixes I found online, but for whatever reason, I still had the problem.

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
Greg
  • 1
  • 1