Search code examples
ms-accessmemo

MSACCESS: How to update a memo field with large text


I've got a memo field in MS Access 2010 and I'm trying to paste a large piece of text in it (about 160k chars).

When I paste directly in the table I get an error that "the text is too long to be edited". The same thing happens when trying to do it via a form.

I've also tried to save the text to a file and the to read the file contents with VBA and then update the table by running a UPDATE table sql statement. In this case I get a runtime error 3035 that "System resource exceeded".

According to this postI should be able to store 1GB of data How can I update a memo field with my text otherwise?


Solution

  • You can use recordsets to update the field. That way, you won't exceed the maximum length of an update query

    (incomplete code, need more details to write more exact code)

    Dim str As String
    'Read text file into str
    Dim rs As DAO.RecordSet
    Set rs = CurrentDb.OpenRecordset("MyTable")
    rs.AddNew
    rs.Fields("MyMemoField").Value = str
    rs.Update
    rs.Close