Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Memo field runtime error

Status
Not open for further replies.

BrenoAguiar

IS-IT--Management
Feb 8, 2005
81
US
HI Folks,

I'm having an error:

(runtime error '3188, could not update; currently locked by another sesion in this machine)

whenever I'm updating a memo field in my table "units". That happens after that field is loaded with more that 2000 caracteres. I've seen some stuff on the internet about it but nothing that would solve the problem. It seems to be an Access Issue with Memo fields (even holding 64,000 caracteres). I'm using an unbound form to update this Memo Field (notes) and the the SQL is:

DoCmd.RunSQL "UPDATE Units SET Notes=[Notes] & chr(13) & chr(10) & chr(13) & chr(10) & [text2] & [addnt] & [space] where [computercode] = '" & Me!compcode & "'"


Any sugestions? Thanks in Advance
 
What type of control on your unbound form are you using to enter the information. Because we use memo fields in tables and have well over 2000 characters in them with no problems.

The problem might be with the control not the memo field. I believe a textbox does have a size limit (don't remember how large), while a richtext box is "limitless" (not really but more than enough in most cases).
 
well, I limited the text box to 460 caracteres by using the following:

Private Sub addnt_Change()
Call LimitChange(Me.addnt, 460)
End Sub

Private Sub addnt_KeyPress(KeyAscii As Integer)
Call LimitKeyPress(Me.addnt, 460, KeyAscii)
End Sub

beeing "addnt" the textbox name. But the thing is that it works fine when submiting the data to the table "Units" before the field on the table, for that specific record, reaches 2000 caracteres. Thats when the error pops up.
 
Maybe something like this:
DoCmd.RunSQL "UPDATE Units SET Notes=[Notes] & chr(13) & chr(10) & chr(13) & chr(10) & '" & Me!text2 & Me!addnt & Me!space & "' where [computercode] = '" & Me!compcode & "'"

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi PHV,
good to "see" you.

Actually, the SQL works fine because until it reaches 2000 caracters its like everything is working as it should. I tryed your code and it gave me the same error.

But I found a way around it: "addnotes" is my unbound form where the user writes his notes. And "Units_bldg" is the form where is bound to the "Units" table. I'm Closing the Form "units_bldg", running the SQL and then, re openning the form "units_bldg".

That took care of it.
But once again I appreciatte your great help PHV!

Breno Aguiar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top