+ Reply to Thread
Results 1 to 15 of 15

Columns in a form

  1. #1
    Forum Contributor
    Join Date
    05-19-2004
    Location
    United States
    MS-Off Ver
    Office XP and Office 2003
    Posts
    127

    Question Columns in a form

    I have a form (dialog box) that displays a table with multiple columns on data. One of the columns shows a field called Description. However, some users see the entire description, while others see the description truncated at different positions. Is there a way to prevent this, so every user would see the entire contents in that column? Is there a way to set up the width so it's dynamic? Thanks.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Problem with columns in a form

    You haven't given any information as to how your form is set up.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    05-19-2004
    Location
    United States
    MS-Off Ver
    Office XP and Office 2003
    Posts
    127

    Re: Problem with columns in a form

    The form just has a listbox with multiple columns in it, one being one called Description. I have attached a screenshot of the form. Is there a way to make it so the user can just click and drag the heading in the form to make it wider?
    Attached Files Attached Files

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Problem with columns in a form

    Not with a listbox, no. If you can use a ListView, then yes; if not, then you will need to provide a mechanism for resizing the columns. (If the data comes form a worksheet, try autofitting the columns of the worksheet, then use those widths for your listbox columns)

  5. #5
    Forum Contributor
    Join Date
    05-19-2004
    Location
    United States
    MS-Off Ver
    Office XP and Office 2003
    Posts
    127

    Re: Problem with columns in a form

    What is a ListView? I've never heard of that before. Some users see it truncated and some don't. And when it is truncated, it's different based on different users computers. Could it be due to different screen resolution settings? If so, would changing it in the code, even help? Thanks.

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Problem with columns in a form

    A ListView is another control that you can add to a form.
    It may be to do with desktop settings like font size and resolution, yes. If you provide a means to make the listbox columns wider, then they can adjust as required, but if you set the listbox to use the same widths as the sheet, it ought to work.

  7. #7
    Forum Contributor
    Join Date
    05-19-2004
    Location
    United States
    MS-Off Ver
    Office XP and Office 2003
    Posts
    127

    Re: Problem with columns in a form

    The columnwidths for the columns on the sheet came back as 10, 39, 13, 10. However, when I set the column widths for those columns in the listbox to those values, the columns in the listbox are way too small and you can one see several characters, if that.

  8. #8
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Problem with columns in a form

    What code are you using to get the widths? I think you have the wrong units.

  9. #9
    Forum Contributor
    Join Date
    05-19-2004
    Location
    United States
    MS-Off Ver
    Office XP and Office 2003
    Posts
    127

    Re: Problem with columns in a form

    For the columnwidths, I just set them to the actual value from the sheet, like the following:
    Please Login or Register  to view this content.
    I've also tried code like the following:
    Please Login or Register  to view this content.
    This code shows it correctly on mine, but not on Chinese users computers. I did notice that the font for the listbox is Tahoma. Is there another font we should use that uses the same width for characters?

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Problem with columns in a form

    I mean how did you get the widths of the worksheet columns? And did you autofit them in the code first?

  11. #11
    Forum Contributor
    Join Date
    05-19-2004
    Location
    United States
    MS-Off Ver
    Office XP and Office 2003
    Posts
    127

    Re: Problem with columns in a form

    I use the following code:
    Please Login or Register  to view this content.

  12. #12
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Problem with columns in a form

    Ah - you actually want the Width property, not the ColumnWidth.

  13. #13
    Forum Contributor
    Join Date
    05-19-2004
    Location
    United States
    MS-Off Ver
    Office XP and Office 2003
    Posts
    127

    Re: Problem with columns in a form

    I have changed it from columnwidth to width and some of the columns are still truncated.

  14. #14
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Problem with columns in a form

    Are you using the same font name and size as the sheet?

  15. #15
    Forum Contributor
    Join Date
    05-19-2004
    Location
    United States
    MS-Off Ver
    Office XP and Office 2003
    Posts
    127

    Re: Problem with columns in a form

    Yes, I'm using Arial font size 10 for both the listbox and the range on the sheet.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1