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 Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Include DESC in filter string
Gregory Clancey 
    
3 years ago
A main Form calls another ("f1017fsiHistory") with the following code in a TextBox of the original, main Form's "On Click" Event Trigger:

DoCmd.OpenForm "f1017fsiHistory", , , "[XSordinal] = " & Chr(34) & Me.x_catID & Chr(34)

it works fine, but is there a way to encode a DESC sort order using the "OpenForm" command line, or should I work out a way to create a new query for the opening Form?
Gregory Clancey OP  @Reply  
    
3 years ago
!! FORGETABOUTIT !!
I went the query route. It was easy and solved other issues as well by allowing me to display other fields as strings (from referenced tables) instead of numeric keyFields. I should have tried this first before calling for the life raft from the mother ship.
Kevin Robertson  @Reply  
          
3 years ago
If you don't want the extra Query you could open the form and reset the Record Source.

DoCmd.OpenForm "CustomerF"
Forms!CustomerF.RecordSource = "SELECT * FROM CustomerT WHERE State=""FL"" ORDER BY LastName DESC"


The above code will Open the customer form, then limit the records to only those customers from Florida, sorting them by LastName in descending order.
Gregory Clancey OP  @Reply  
    
3 years ago
Thanks. Handy to know. It turns out, though, that a query is useful for yet another Form opened by this trigger. The query works nicely, but I'll remember this code sequence because it will come in handy often in my development work. I'm taking in so much new material that I fear soon my hat won't fit any more.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer 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: 6/22/2026 2:17:34 PM. PLT: 0s