Don't alphabetize the spaces

G

Guest

In my table, I'd like to tell Access, "Hey, you've been alphabetizing pretty
well, but would you mind just ignoring spaces from now?" For instance, Access
alphabetizes like so, as it thinks a space is a higher priority than a letter:
Mc Donnel
McDonnal
If I had my way with Access, it would alphabetize them the other way around,
just ignoring the spaces in the words.
 
L

Larry Linson

In my table, I'd like to tell Access, "Hey,
you've been alphabetizing pretty well, but
would you mind just ignoring spaces from
now?" For instance, Access alphabetizes
like so, as it thinks a space is a higher
priority than a letter:
Mc Donnel
McDonnal

Access does not "think" a space is a higher priority than a letter -- that
is the defined collating sequence for text.
If I had my way with Access, it would
alphabetize them the other way around,
just ignoring the spaces in the words.

How would it know whether a space was "in a word" or "between two words"?

In the Query you are using to retrieve the data, create a calculated Field,
using the Replace function to replace each " " with a null-string "". Then
sort on the calculated Field, which will do exactly what you want.

You can't "tell it in your table," however. That isn't one of the properties
of a table, nor can you attach code to a table.

Larry Linson
Microsoft Access MVP
 
G

Guest

I'd like for it to ignore all spaces in a given query. How do I use the
Replace function?
 
J

John Vinson

I'd like for it to ignore all spaces in a given query. How do I use the
Replace function?

Type

SortKey: Replace([fieldname], " ", "")

in a vacant Field cell. Use this field for sorting.

John W. Vinson[MVP]
 

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