arpeggione
Programmer
Hi All:
I have gotten LOTs of help over the past few years on this and other forums. So...Below is a solution to the Error 3188 (when saving a memo field with over 2000 characters) error - and, by george...it actually works for me. The idea - cut the memo text into sections of less than 2000 characters and save a section at a time with a "for-next" loop. It worked for a memo field of 13,000 characters - a huge one, I can't say)....Doubtless, someone may have a better way to do this, but here it is!
Cheers,
Karen (aka Arpeggione)
myCharCount = Len(Forms!frmeditevents!txtEditDSNotes)
myMemoText = Forms!frmeditevents!txtEditDSNotes
'MsgBox "memo field has = " & myCharCount & " characters"
If myCharCount > 2000 Then
rstEvents.Update
'Round up
numStrings = -Int(-1 * myCharCount) / (2000)
'MsgBox numStrings
Exit Sub
For i = 0 To numStrings - 1
myMemoTextSection = Mid(myMemoText, (i * 2000) + 1, 2000)
'MsgBox myMemoTextSection
rstEvents.MoveLast
rstEvents.MoveFirst
rstEvents.Bookmark = varBookmark
'MsgBox rstEvents("syseventID")
'Exit Sub
rstEvents.Edit
rstEvents("Notes") = rstEvents("Notes") & myMemoTextSection
rstEvents.Update
Next
Else
rstEvents("Notes") = Me.txtEditDSNotes
'Me.Refresh
rstEvents.Update
End If
I have gotten LOTs of help over the past few years on this and other forums. So...Below is a solution to the Error 3188 (when saving a memo field with over 2000 characters) error - and, by george...it actually works for me. The idea - cut the memo text into sections of less than 2000 characters and save a section at a time with a "for-next" loop. It worked for a memo field of 13,000 characters - a huge one, I can't say)....Doubtless, someone may have a better way to do this, but here it is!
Cheers,
Karen (aka Arpeggione)
myCharCount = Len(Forms!frmeditevents!txtEditDSNotes)
myMemoText = Forms!frmeditevents!txtEditDSNotes
'MsgBox "memo field has = " & myCharCount & " characters"
If myCharCount > 2000 Then
rstEvents.Update
'Round up
numStrings = -Int(-1 * myCharCount) / (2000)
'MsgBox numStrings
Exit Sub
For i = 0 To numStrings - 1
myMemoTextSection = Mid(myMemoText, (i * 2000) + 1, 2000)
'MsgBox myMemoTextSection
rstEvents.MoveLast
rstEvents.MoveFirst
rstEvents.Bookmark = varBookmark
'MsgBox rstEvents("syseventID")
'Exit Sub
rstEvents.Edit
rstEvents("Notes") = rstEvents("Notes") & myMemoTextSection
rstEvents.Update
Next
Else
rstEvents("Notes") = Me.txtEditDSNotes
'Me.Refresh
rstEvents.Update
End If