Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Sort Order Text in Report
Jorge Restrepo 
     
2 years ago
Hello,
Is there a way text fields can be sorted in a report as if they were numbers.  For example, if I have fields 64, 75, 125, 126A, 128, they are sorted in the following order: 125, 126A, 128, 64, 75.  I would like them to be sorted as indicated initially. Is there a a way to do that without having to use a sort order field, o adding leading zeros to the fields ?  Thanks.
Ludwig Willems  @Reply  
      
2 years ago
volgen :)
Sami Shamma  @Reply  
             
2 years ago
Check this Video out
Numbers As Text
Richard Rost  @Reply  
          
2 years ago
So, you want to be able to store them in a text field, but yeah, you want to ignore the letters and sort them numerically by just the number portion? Is that correct?
Jorge Restrepo OP  @Reply  
     
2 years ago
Thanks Sami, the video explains it well.  For a report based on a query it works very well.  For forms where the data sources are tables is there a solution besides a sort order field or making the query the data source for the form ? Try to avoid Queries as data sources for forms .....
Sami Shamma  @Reply  
             
2 years ago
If you know SQL, change the name of the table in the Record source to a SQL statement. If you do not know SQL, you should learn it, it will make your life so mush easier. Richards SQL seminars Access SQL Seminars
part 1 and 2 are worth every penny.

so instead of for example CustomerT in the record source, you will have something like:

SELECT * FROM CustomerT WHERE CustomerState = "FL" ORDER BY CustomerLastName

An easy way to get the SQL is to create the query then switch the query to SQL view and copy the statement to use as a record
source then delete the query.
Jorge Restrepo OP  @Reply  
     
2 years ago
Thanks Sami, got to learn and use SQL !!!!!
Sami Shamma  @Reply  
             
2 years ago
Thank you Jorge
Kevin Yip  @Reply  
     
2 years ago
You can still use a table-only record source, but with the "Order by" property set to Val([fieldname]), which will sort the form by the numeric value of [fieldname].  See picture below.  [fieldname] needs to be in the table, but doesn't need to be on the form.  Note that Val() will convert anything that begins with a numeric character to a number: Val("2abcde") --> 2.
Kevin Yip  @Reply  
     
2 years ago

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: 5/2/2026 7:09:23 AM. PLT: 0s