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

Simple sort

Status
Not open for further replies.

maxster

Programmer
Sep 3, 2002
45
GB
I have created a form which has a combo box obtaining its data from a table containing a list of floors in a building. When the combo box is used it displays the floors as 1,11,12,13,2,21,22,3,31 etc.

How can I display them as 1,2,3,4,5 etc.

Within the table they are in the correct order.

Thanks
 
Your datatype might be text.. you need to change it to number in the design view of the table.

________________________________________________________
Zameer Abdulla
Help to find Missing people
There’s a world of difference between editorials and advertorials
 
Hi
Is it possible that floor number is a text field and that the reason it is in the correct order is that the floor numbers are entered sequentially in a table with a numeric key field? If so, you could:
- Change the field to numeric
- Include the key field as a hidden sort column in the combo
- Use Cint or Val in a query display the floor as a number.
The first option might be the best.
 
ORDER BY Val([Floor]), [Floor]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks you all for your help, I changed it to numeric and that sorted the problem.

'Maxster'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top