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 
VBA Order By Multiple Fields
Monica Jones 
       
3 years ago
I have a continuous form that I want to order by last name, then first. I've guessed at a few things but Access either yells at me or only orders by last name. TIA
Kevin Robertson  @Reply  
          
3 years ago
In the Record Source for the form use an SQL statement.

For example:
SELECT * FROM CustomerF ORDER BY LastName, FirstName
Scott Axton  @Reply  
      
3 years ago
Check out the Click to Sort video.  That may be something that would interest you.

Richard Rost  @Reply  
          
3 years ago
In the Order By property you can literally just put:

LastName, FirstName

And if you want it to sort when the form opens, make sure Order On Load is set to Yes. Order By, Filter On Load
Monica Jones OP  @Reply  
       
3 years ago
Kevin, when I try to add ", FirstName" to my from record source it refuses to save. Richard, I've done that, to no avail.
If it makes a difference I'm trying this in conjunction with the Search As You Type extended cut. I'll attach pictures below. Here's my code for the clear button and it just ignores the FirstName part:
Private Sub ClearSearchBtn_Click()
    SearchBox = Null
    Me.RecordSource = "SELECT * FROM RecipientT ORDER BY LastName, FirstName"
End Sub
Monica Jones OP  @Reply  
       
3 years ago

Monica Jones OP  @Reply  
       
3 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: 8/8/2026 2:25:32 PM. PLT: 1s