I have a combo box whose source is a table. The list contains room numbers
such as A-1, A-2, A-12. My sort is ascending, but, of course it lists them
A-1,A-2, A-12. Is there a way to fix this? Thanks
If (and it's a big if!) the room number is always of the format text - hyphen
- number, and you want it sorted by letter and then by number, you'll need to
split them apart in the Query upon which the combo is based:
SELECT RoomNumber, Left(RoomNumber, InStr([RoomNumber], "-") - 1) AS
RoomLetter, Val(Mid([RoomNumber, "-" + 1)) AS RoomNumberValue
FROM tablename
ORDER BY RoomLetter, RoomNumberValue;
Note that a combo based directly on a table might or might not sort in the
order you expect - a table HAS NO ORDER and will be presented in whatever
order Access finds convenient.