Results 1 to 6 of 6
  1. #1
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    283

    Limit the displayed characters in a list box column

    Folks

    On my form I have a list box that contains some values that are too long for the width of the box. This looks scruffy. Is there any way to display only a specified number of characters and, preferably, append an ellipsis ('Ö')?



    Remster

  2. #2
    ajetrumpet is offline Banned
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I doubt it remster. the box is one object. check out the 'column width' property, which is different than the actual 'width' property. what I do with mine is make the col width the same as the box width and make sure it is long enough for the longest value in the list...

  3. #3
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    283
    I suspected as much. Thanks for giving it some thought anyway.

  4. #4
    slave138's Avatar
    slave138 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    WI
    Posts
    233
    If you use a List with multiple fields (one to hold the actual value and another to hold the displayed text) it is quite possible to do. See the attached example for one way to do it with something like:
    Code:
    Left([DisplayText], 10) & IIf(Len([DisplayText] > 10, "...", "")

  5. #5
    Remster is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    283
    Hurrah! I've put the code in the Row Source field rather than a separate query, but it seems to work fine:

    SELECT Forms.ID, Left(Forms.[Form name],10) & IIf(Len(Forms.[Form name])>10,"...",""), IIF(Forms.[Current form?]=True,"Current version") FROM Forms ORDER BY Forms.[Form name];

    Many thanks.

  6. #6
    slave138's Avatar
    slave138 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    WI
    Posts
    233
    My pleasure

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

Similar Threads

  1. Populating list box with column heading?
    By kawi6rr in forum Programming
    Replies: 1
    Last Post: 08-13-2010, 12:51 PM
  2. Limit to List difficulty
    By cjtemple in forum Forms
    Replies: 1
    Last Post: 07-02-2010, 10:50 AM
  3. New JPGs Not Displayed
    By DJMoore in forum Access
    Replies: 1
    Last Post: 11-15-2009, 05:30 AM
  4. List box column check..
    By empyrean in forum Programming
    Replies: 1
    Last Post: 10-28-2009, 08:18 AM
  5. Replies: 2
    Last Post: 08-04-2008, 04:16 PM

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 - Senior Forums