sort alphabetically

G

Guest

I've got a table with a field I'd like to sort alphabetically. The filed is
the primary key. It is a text field that has some entries that contain text
and numerical values. For example:

Wood Class 1
Wood Class 2
Wood Class 3
Wood Class 10
Wood Class 20

Of course, the table sorts them in this manner:

Wood Class 1
Wood Class 10
Wood Class 2
Wood Class 20
Wood Class 3

Is there a way I can sort these in true numerical sequence as above? I'm
using this table as the Row Source for a combo box LookUp and having the
numbers sorted in sequence is the preference.

THANKS!!!
 
G

Graham Mandeno

Hi John

Does every record have a "ClassName" and a "SequenceNumber"? If so, I would
divide it into two fields - one text and one numeric. Make it a composite
primary key (or, if it's the one-side of a one-to-many relationship, add an
autonumber as a surrogate primary key).

Then your combo box RowSource can be something like this:
Select ClassName & " " & SequenceNumber from YourTable
order by ClassName, SequenceNumber;
 
G

Guest

Thanks, Graham!
--
www.Marzetti.com


Graham Mandeno said:
Hi John

Does every record have a "ClassName" and a "SequenceNumber"? If so, I would
divide it into two fields - one text and one numeric. Make it a composite
primary key (or, if it's the one-side of a one-to-many relationship, add an
autonumber as a surrogate primary key).

Then your combo box RowSource can be something like this:
Select ClassName & " " & SequenceNumber from YourTable
order by ClassName, SequenceNumber;
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

JohnLute said:
I've got a table with a field I'd like to sort alphabetically. The filed
is
the primary key. It is a text field that has some entries that contain
text
and numerical values. For example:

Wood Class 1
Wood Class 2
Wood Class 3
Wood Class 10
Wood Class 20

Of course, the table sorts them in this manner:

Wood Class 1
Wood Class 10
Wood Class 2
Wood Class 20
Wood Class 3

Is there a way I can sort these in true numerical sequence as above? I'm
using this table as the Row Source for a combo box LookUp and having the
numbers sorted in sequence is the preference.

THANKS!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top