views:

48

answers:

2

We have a standard Access listbox with multiple columns. Is there a way to have integer or currency columns right aligned?

+2  A: 

As far as I'm aware, not in the traditional sense, no. I believe there are some third-party products that might be able to do this, but there's no native ColumnAlignment properties for listboxes in any versions I've used (haven't used Access 2007, though, for what it's worth).

Depending on how you are loading the listbox, you could use a fixed-width font (such as Courier) and left-pad your numbers with the appropriate number of spaces, to emulate right-alignment. It's not ideal, but it may be worth a shot.

LittleBobbyTables
+4  A: 

No. The closest I've seen is JustiCombo which is a database containing functions to center and right justify data for List and Combo Boxes. It can use proportional fonts by analysing the font attributes and character widths. It too stuffs spaces in the front of the fields to make the data appear centre/right justified. It did the best it could but you could see a few jaggies. But then maybe I was being too critical.

Tony Toews
thanks for the answer but this sounds horrible!
hawbsl
+1 for the "No" though
hawbsl
Actually it does work reasonably well. And it's quite interesting reading the API code figuring out how Stephen coded it.
Tony Toews
i have total respect for Stephen Lebans and have used his stuff in the past. but in my case right aligned columns was a nice-to-have, not something i want to go out to a third party control for. thanks for the info though. the api would be interesting sure, at a time when i'm not up against a deadline.
hawbsl