Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2004
    Posts
    10

    Question Unanswered: Limitations for text a listbox?

    Does anyone know if there is a limit for the number of characters in a Listbox column?

    One of the columns in my listbox is pulling a Memo field, that definitely has more than 255 characters. I am then displaying the data in a separate text box, that updates as the User click on a row in the listbox.
    However, my text box is displaying truncated data--when I counted it it seemed to mysteriously stop at the 254th character (probably with a trailing space?)----

    Oh yeah--forgot to mention--all of my controls are unbound and are set at runtime. I also do not want to set the text box to a specific table, as the table is constantly changing based on what is loaded in the listbox.

    Any help at all would be greatly greatly appreciated!

  2. #2
    Join Date
    Sep 2004
    Posts
    10
    ::bump::
    Someone out there has had to run into this....where are you? Please help! I'll be your Best Friend!

  3. #3
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    im not 100% sure on this, but i think it is the same as a standard tet box, thus 255 characters. I'll have a lok around and see what i can dig up.

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by misty19
    Does anyone know if there is a limit for the number of characters in a Listbox column?

    One of the columns in my listbox is pulling a Memo field, that definitely has more than 255 characters. I am then displaying the data in a separate text box, that updates as the User click on a row in the listbox.
    However, my text box is displaying truncated data--when I counted it it seemed to mysteriously stop at the 254th character (probably with a trailing space?)----

    Oh yeah--forgot to mention--all of my controls are unbound and are set at runtime. I also do not want to set the text box to a specific table, as the table is constantly changing based on what is loaded in the listbox.

    Any help at all would be greatly greatly appreciated!
    Textboxes can handle a memo field completely ... They have the same limit as the memo field: 64K. As for the listbox, Most likely it has a limit of a text string (255 chars) ... As you've sees ... Now, how to get around it ... on your click event why not write a bit of code to update the textbox ... Ex:

    Code:
        Dim TrgRecSet As ADODB.Recordset
        
        Set TrgRecSet = New ADODB.Recordset
        
        TrgRecSet.CursorType = adOpenDynamic
        TrgRecSet.LockType = adLockOptimistic
        TrgRecSet.CursorLocation = adUseClient
        
        ' Retrieve the Work Order & Customer
        SQLString = "SELECT SomeText FROM SomeTable WHERE (SomeColumn=" & ListBox.Column(XXX,ListBox.ListIndex & ");"
        MyRecSet.Open SQLString, CurentProject.Connection
        If MyRecSet.BOF = False Then
            MyRecSet.MoveFirst
            Textbox.value = MyRecSet.Fields(0).Value & ""
        End If
        MyRecSet.Close
    Back to Access ... ADO is not the way to go for speed ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •