Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jan 2003
    Location
    Grass Valley, California, USA
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access Listbox (2000)

    I have a listbox populated with an 8-column pre-stored query. Some of the columns are text information, and others are numerical data. I find that all column data is being displayed left-adjusted. I tried setting the listbox property of TextAlign to some other value, but it seems to not cause any visible effect. Ideally, I'd like some method to have the text columns left-adjusted, and the numerical columns right-adjusted. I cannot seem to find any technique to accomplish this.

    Does anyone have a solution?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access Listbox (2000)

    The standard Access list box doesn't offer this feature; it treats all columns as text, hence left-aligned. You probably need advanced Windows API programming to make a list box center or right-align columns. See for example JustiCombo on Stephen Lebans' website.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Access Listbox (2000)

    I've done it from VBA code by building a padded string for each column in the list and using a callback function to build the list, but I don't recommend the exercise. <img src=/S/nope.gif border=0 alt=nope width=15 height=15> You run into problems depending on the font and point size you use, and it is much less frustrating to use something pre-built such as Hans' recommended.
    Charlotte

Posting Permissions

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