
Originally Posted by
Bigdoggit
I have an unbound text box on a form. The form is bound to a query but only for reading records. The unbound text box is programatically populated with data from the form's recordset. If the text gets around 2038 characters long trying to save via the form produces the error "could not update; locked by another session on this machine." I can still update via the table, just not the form. Also, if I have the form viewing the record containing this long text then even via the table it says the record is locked and cannot be updated.
**The field in question is in its own table because it is a memo field that gets changed regularly in production. The production environment has this as a bound control but I am trying to implement unbound controls to avoid excessive record locking.**
Is there some limit on text controls regarding length of text? I cannot find anything by googling or searching this forum.
You can use the field size if the control is bound to a table. (So view the table design view and goto the field name in context and change the size) if you wish to only allow certain key presses then something like the following will suffice. i.e Only numbers allowed!)
Code:
Private Sub txtEntranceDoorsFlatsRenewYear_KeyPress(KeyAscii As Integer)
'If a backspace (ASCII-8) or a tab (ASCII-9) was
' entered, allow it unconditionally.
If (KeyAscii = 8) Or (KeyAscii = 9) Then Exit Sub
If IsNumeric(Chr(KeyAscii)) <> True Then KeyAscii = 0
End Sub