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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Precede less than 10 with Zero

Status
Not open for further replies.

Drenda

Programmer
Sep 1, 2007
85
GB
Can anyone please help

I have a query for a Combo box that is set to create an ascending list of numbers ranging from 0 to potentially infinity. Unfortunately the results shown in the combo drop down list are not ascending where numbers are less than 10 so for example they may be shown as
1
10
11
2
20
21

I assume that if I precede single digits with a zero it will fix the problem so the list will then become
01
02
10
11
20
21

My problem is I have tried to set the number via a macro where if the number is less than 10 then (through the macro set value option)i set it with a "0"+[Number less than 10] but I still end up with a single digit number

Many thanks in anticipation of any help
 
What is the SQL code of your combo's RowSource ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for the response although I'm no expert but this may not help as the Query is a result of four previous queries and may be difficult to explain. If there is a simpler way perhaps you can advise, if not then many thanks anyway
 
You understand that for the "numbers" to be sorted in this fashion, they're not actually "numbers," which is to say, numerical, but rather are text made up of digits!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Tip:
ORDER BY Val([your field name])

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top