Thread: Sorting data
View Single Post
  #3  
Old March 17th, 2010, 12:19 AM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default Sorting data

What data type is your Size field?

You may need to use a Number field rather than a Text field. Text fields
sort character-by-character. That means 10 sorts before 8, because the first
character (a 1) comes before the first character of the other value (an 8.)

BTW, you may want to avoid using reserved words as field names. That
includes:
- Name (known to give problems in forms and reports, where Access can
mistake it for the Name of the form/report),
- Format (a field property), and
- Size (reserved in JET SQL)

For a complete list of the names to avoid when designing your tables, refer
to:
http://allenbrowne.com/Ap****ueBadWord.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Rob H" wrote in message
...
I have a table named Items, in this table the items are defined by Name,
Size, and Format. When first setting up the table I added a few of my
items
to get the process going. I then created a query based on this table to
sort
by name, size, and format. When creating a sort order in the query by
Name(Ascending), Size(descending), and Format(Ascending) the result works
perfectly.

However, after adding new items either through the Table or Items Form I
created, the sort works for Name and Format but the Size is not following
the
sort order(new itemssize is actually being ordered in reverse while the
original entrys are being sorted properly), short of re-creating the whole
Items table I have tried deleting the query and starting over, clearing
all
sorts in the query and doing a refresh and save and then re-creating the
sort
orders with the same results.

This is something basic but I can't seem to figure it out.