Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Click to Sort < File Sharing | Access Jobs >
Back to Click to Sort    Comments List
Upload Images   Link   Email  
Issue with sort
Jeffrey Rainey 
     
2 years ago
I have adapted my code to fit the demonstrated code in this video. It 'works' except  the 7 records goes to one.

S= 'SELECT * FROM tblProjectDetail ORDER BY ' &  OrderByStr
Scott Axton 
          
2 years ago
Jeffrey Rainey OP 
     
2 years ago

Jeffrey Rainey OP 
     
2 years ago

Jeffrey Rainey OP 
     
2 years ago

Jeffrey Rainey OP 
     
2 years ago
Thanks. Point well taken. It's difficult to be precise on asking a question. Harder without context.

This is on a subform. It works fine when running alone but on a parent form the sort results in one record
Alex Hedley 
            
2 years ago
Can you print or MsgBox "S" to see what the difference is?
Jeffrey Rainey OP 
     
2 years ago

Jeffrey Rainey OP 
     
2 years ago

Alex Hedley 
            
2 years ago
Do you have the Link Parent/Child fields set on your SubForm?
Jeffrey Rainey OP 
     
2 years ago

Alex Hedley 
            
2 years ago
So is there only 1 record for that specific Parent?
Jeffrey Rainey OP 
     
2 years ago
There are 7 (see first photo) then only 1 in list (second photo) when it is sorted
Kevin Yip 
     
2 years ago
Remove "On Error Resume Next" to see if there are any run-time errors.  I don't see anything wrong in the code you posted, but maybe there is an error elsewhere.

If you only need to sort, you can just use the OrderBy property instead of changing the Recordsource:

    Me.OrderByOn = True
    Me.OrderBy = "Looptag"    ' or "Looptag DESC"

Changing OrderBy doesn't require a requery, so it is faster than changing the record source if the table is big.
Jeffrey Rainey OP 
     
2 years ago
Thank you. That works

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

 
 
 

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 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 1/14/2025 10:52:39 PM. PLT: 0s