Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Query question on sorting
Lee Shastid 
    
3 years ago
I am running a Query and in one column in the sort criteria i can choose non, ascending, descending. It sorts everything and looks okay. One thing it does that I can not figure out how to tell it to change is when it sorts in ascending it will line it up like 1,10,11,12 etc then so on. What I would like it to do is be sequential like 1,2,3,4 etc.
Kevin Robertson  @Reply  
          
3 years ago
If the field is Short Text you will get an alphanumeric sort like you described.
If you want the numbers to be in the correct order make the field a Number data type.
Scott Axton  @Reply  
      
3 years ago
If you are sorting a text value you will always get the  1, 10, 11 sort.  (The  other is a numeric value)
In order to get it to sort you would have to convert it to a numeric either in the table design or through your query criteria.
See the picture below.  

If the TextField contains any non-numeric value the CInt() function will produce an error.
Note also the alignment of the values in the field.  

Numeric values are Right aligned.  If you right click on them in the datasheet view you will see the Sort Smallest to Largest.

Text values are Left aligned.  If you right click on that field you will see the Sort A to Z.

Hope that helps.
Scott Axton  @Reply  
      
3 years ago

Kevin Robertson  @Reply  
          
3 years ago
To get rid of that error is easy enough.

Conv: IIf(IsNumeric([TextField]),CInt([TextField]),Null)

Then you can add Is Not Null as the criteria for that field if you don't want to see it in the final result..
Scott Axton  @Reply  
      
3 years ago
I know you said you watched it but you can review the sorting and queries in Lessons 8 and 9:
Access Beginner 1 Lessons
Scott Axton  @Reply  
      
3 years ago
Kevin I didn't want to confuse the issue.  Sorting is the problem right now with current knowledge level.  However - good point.
Lee Shastid OP  @Reply  
    
3 years ago
Kevin I understand what you are saying about the short text and numeric data type in the tables. I think what my problem is I cant make the field numeric because the item numbers are alpha & numeric.  They are numbered like CApro-1, CApro-2. I think it will probably be best to come up with a structure to be numeric, or alpha solely. Scott you are correct on your last statement, and thank you for recognizing that. To clarify my statements the other day I was not trying to be snarky. I just don't have enough involvement with computers to keep me that involved. Other than just everyday computing. Thank you to both for your help.
Scott Axton  @Reply  
      
3 years ago
Lee I don't know how you are getting your number portion prior to the -  .
There are ways to extract that out.  There are videos for that if you are interested.

I don't know how many your numbering scheme goes up to.  10's, 100's?
It might be as simple as changing the numbering to CApro-01, CApro-02 or CApro-001, CApro-002.
Videos for this as well.  Just let me know and I'll find them for you.
Lee Shastid OP  @Reply  
    
3 years ago
Kevin Thank you for your response. My numbers as of right now go up to almost 200. This will go higher as I add to it. My exact numbering is like this. 320ca-1, 320ca-2, 320ca-3, 320ca-4, ra14-1,ra14-2, ra14-3, etc.
Lee Shastid OP  @Reply  
    
3 years ago
I am sorry that previous post was a thank you to Scott. I was looking at previous post and just typed the name that I looked at. And yes Scott I would I am interested.
Scott Axton  @Reply  
      
3 years ago
Lee sorry for being a bit getting back.  Going through some personal stuff that is taking front seat at the moment.

It would be very helpful if you could provide additional information on your db.

Screen shots showing the structure of your fields.  Some actual data. etc.
How are you coming up with your naming?  Are you entering it in manually or deriving it from other fields?

Since I don't see that you have courses under your belt, as I mentioned before, it would be helpful if you could provide a little of your background in Access.

There are several free videos on Richards site that deal with naming your custom numbers.  
See the Sequential Numbers as an example.

Though you will get the most benefit if you at least go with the Silver level membership.  For the cost of a cup of coffee PER MONTH you can get access to literally hundreds ove videos including the extended cuts.  If you decide it isn't a good value for you there isn't any long term  obligation.  You can save an additional 20% of the Annual.  See TechHelp Memberships

While the TechHelp are very good and, in theory you could build some awesome dbs just from those,  they are not  meant as a replacement for the full courses.  Rather the are intended as a suppliment.

Lee Shastid OP  @Reply  
    
3 years ago
Scott
Thank you. My numbering was self numbering and I figured it be best to keep everything simple instead of confusing myself further. I am going to watch some of the videos that you mentioned. Basically I am finished with that DB to where I need it and can use it and get the information out of it like I want. Like Richard said work on one or two for fun stuff before I get serious into it and that's what I am doing. I have started one for my sports cards like baseball and football and I have noticed one thing see if you can answer for my if you don't mind. In my category for sports football and baseball and all sports etc. I created a lookup wizard with drop down box. It works fine. I created another field for brands with a drop down list also.. I noticed on the field for brands i get the edit list box under the drop down when i click on the drop down arrow but i dont on the category field
Scott Axton  @Reply  
      
3 years ago
That is due to your settings in the ComboBox under the data tab.  The Limit to List and the Allow Value List Edits.
You can see more about that in several free videos:
Value List Combo
Relational Combo
List Items Edit Form

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 8/8/2026 10:28:27 AM. PLT: 2s