Sorting data

R

Rob H

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 items>size 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.
 
S

Steve

You were given the solution when you posted on 3/13 but you chose to follow
Arno R and Visio John. So now....

Get Lost !!!!

Steve
 
A

Allen Browne

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/AppIssueBadWord.html
 
F

Fred

Plus a couple of basic things I'm sure you already checked.

Make sure your only sorts are in the Query grid (or SQL) Make you haven't
used the "A-Z" sort button (or do records->Remove Filter/Sort)

Order the columns per your desired sort hierarchy.
 

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