I'm using a richtext box to concatenate a log message.
And it seems I got an error: "the settings of this property is too long"
So is there a size limit ?
My code is very simple: I call multiple times:
Public Function showMessage(MyTxtBox As String, ByVal message As String)
Dim frm As Form
On Error GoTo showMessage_Error
Set frm = Forms.Item("FrmMessage")
frm(MyTxtBox).Parent.SetFocus
frm(MyTxtBox).Text = frm(MyTxtBox).Text & message & Chr(13) & Chr(10)
On Error GoTo 0
Exit Function
showMessage_Error:
'MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure showMessage"
frm(MyTxtBox).Text = ""
Resume Next
End Function
I use MS Access` TextBox selecting RichTextBox option;
As you can see I have partially solved the problem by using
frm(MyTxtBox).Text = ""
Resume Next
when an error occurs but that means I will lose all previous messages.
Isn't this incredible ?
Update: The form should not close by itself as It must be visible all the time as log message is appended to the form several times during a long processing task (importing several files in my case).