Results 1 to 3 of 3
  1. #1
    Bigdoggit is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2011
    Posts
    27

    Text Box control and character limit?


    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.

  2. #2
    GraemeG is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Feb 2011
    Posts
    152
    Quote Originally Posted by Bigdoggit View Post
    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

  3. #3
    Bigdoggit is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2011
    Posts
    27

    Hmmmm

    This is an unbound control. I don't want a limit since the field where I save data to is a memo type. I am also not trying to limit the characters they can enter, but I might prevent them from entering double quotation marks later, hadn't thought of it until you made a mention so thank you for ringing that bell.

    I suppose I am still lost as to why I am getting the error message I get only when updating the field via an Execute command in VBA.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 12-26-2010, 10:56 PM
  2. Import Text File Size Limit
    By wfbp in forum Import/Export Data
    Replies: 1
    Last Post: 11-04-2010, 09:05 AM
  3. Replies: 4
    Last Post: 10-07-2010, 09:42 AM
  4. Replies: 11
    Last Post: 07-20-2010, 06:55 AM
  5. Control Source for Text Box (#error)
    By km8415 in forum Forms
    Replies: 3
    Last Post: 06-27-2010, 10:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums