How do I get a field to sort right:
M1
M2
M3
Instead of
M1
M10
M2
How do I get a field to sort right:
M1
M2
M3
Instead of
M1
M10
M2
If always starts with M add a field to the query SortOn:cLng(Replace([id],"M","")) or SortOn:cLng(Mid([id],2))and sort on that instead.
Cheers,
Sorry it's not a Query. it is a list in a table.
For info, as its a text field, it is sorting correctly already, but alphabetically.
If all records start with M, another method of doing this is to use a number field but format it for display purposes with a leading M. That will sort the way you want
or modify the number part when created so they are all the same length
M01
M10
M02
if your number part is expected to reach 3 digits then you would need
M001
M010
M002
when you create your code to add the preceding zeros you would use something like
"M" & format(num,"00")