Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Align items in a Value List

Status
Not open for further replies.

theSizz

Technical User
Apr 22, 2002
93
0
0
US
I have a form that has a combo box control that uses a value list for its row source type.

My problem is the appearance of the list. The drop down list contains 2 and 3 digit numbers. I can't find a way to make the numbers in the list align to the right as you would expect to see normal number alignment. The numbers align from left to right rather than right to left. Is there any way to format the drop down value list?

Setting the Text Align property on the control only affects the way the value is displayed in the control and has no affect on the drop down list.

Any ideas would be appreciated.
Thanks

 
Sounds as though you may have to pre format your list before it is used in the combo drop down list.

you may have to convert the numbers into strings and add spaces depending on the length of the strings, then using val() to recalculate the selected number.

eg table 1

1.024
26.35
99.1
999.01

decimal point aligned using format(number,"000.000")

001.024
026.350
099.100
999.010

or right aligned using...
space(numberOfCharacters - len(cstr(number))) & cstr(number)

-1.024
-26.35
--99.1
999.01




Ian Mayor (UK)
Program Error
Always make your words sweet and nice. Because you never know when you may have to eat them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top