Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Click to Sort    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Combo Boxes
Monica Jones 
       
9 months ago
Great video, one question. I have a lot of combo boxes on my forms and would like to sort by what they display, not the ID that is the Control Source. Is there a way around this?
TIA
Monica
Kevin Robertson  @Reply  
          
9 months ago
You can add a sort when you build your Combo Boxes.
Or add an ORDER BY to the Row Source.

SELECT CustomerID, FirstName FROM CustomerT ORDER BY FirstName;
Lars Schindler  @Reply  
     
9 months ago
Monica
Is what the combo boxes display part of your form's RecordSource?
If so, you can set the corresponding fields in OrderByStr as desired.
However, the form will probably need to have a RecordSource that contains multiple tables and multiple joins.
Monica Jones OP  @Reply  
       
9 months ago
Lars It isn't part of the RecordSource, that's where I really got tripped up. It's part of a helper table I use for names. I'll continue digging and Googling and let y'all know if I find something.
Donald Blackwell  @Reply  
       
9 months ago
You could build a query based on the main table and include the "*".

Then, add the tables for each of the combo boxes to the view and be sure to set the relationship showing all records from the main table and only those records from the secondary table(s) where they match the id referenced in the main table. Then, just add the text of each of the combo to the grid at the bottom and they will be there to sort on.

You just have to watch that the query doesn't get too complex to be updatable.

Then, set the record source of your form to that query.

Example, an employee table might have PrefixID, FirstName, MidName, LastName, SuffixID, among other fields.

You would do a query on EmployeeT and include the *

Then bring in the helper table, SuffixT for example, and only include the SuffixText field. And the same for PrefixT, PrefixText (or whatever you call your helper tables.

Then, you'd be able to have your form sort, example, LastName, Suffix, Prefix, FirstName, MidName, or whatever fields you need.
Monica Jones OP  @Reply  
       
9 months ago
Donald gold star for you! It didn't overcomplicate like I thought it would and bonus, if you refer to it as [Lookup_GtwyCombo].[GtwyName] you can sort by the name in the combo instead of the id in the combo!

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

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/9/2026 8:08:21 PM. PLT: 1s