Combo box, sort selected items first then non selected items in Multi select combo box... Ms Access

How to sort selected items first then non selected items in Multi select combo box... Ms Access
Sreeni KambalaAsked:
Who is Participating?
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
Also, it is not possible to filter choices for a multi-select combobox if, for instance, a trainer just teaches certain types of classes.

I see you started with a template.  My recommendation, sad to say, it not to use the templates.  Better to build it yourself so it makes sense and works for a serious business.  To get started, read this free short book:

 Access Basics
http://www.AccessMVP.com/strive4peace
Free 100-page book that covers essentials in Access
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
what field decides if they are selected? What is the RowSource for your combobox?

if, for instance, you have a Yes/No field in your table that is keeping track of what is selected, you can add a column to the Query to sort and not show. True is -1. False is 0.
0
 
Sreeni KambalaAuthor Commented:
SELECT tbl_Courseprofile.COURSE_NAME, tbl_Courseprofile.COURSE_ID
FROM tbl_Courseprofile
ORDER BY tbl_Courseprofile.COURSE_ID;

But I would like to sort on multi select items first.check box.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
Would you post an example?
0
 
Sreeni KambalaAuthor Commented:
I would like to see selected 4 subjects on top then non selected subjects 2 subjects.see attached file.
subject.jpg
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
by example, I meant an example database. Thanks.

Where do you want to display the selections? If in a report or query, there needs to be a field to save if it is selected.  I sometimes create a temporary YesNo field for processing for occasions like this.
0
 
Sreeni KambalaAuthor Commented:
ATTACHED DB,
sample.accdb
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
thanks for posting a sample.
What are you going to do with this information? where do you want the sorted list to appear? Just write it to a control on the form and do nothing else? On a Report? If a report, or for remembering, there needs to be a field to store whether or not it is selected.

It appears to me that you perhaps need a TrainerCourses table with foreign keys relating to ID in the Trainer table (that is what should be called TrainerID -- I would call the text field TrainerCode) and COURSE_ID
0
 
Sreeni KambalaAuthor Commented:
What are you going to do with this information? -> I use this information in edit mode, If I want to deselect one subject, it is easy to see selected items first.This will help when I have hundreds of records.

where do you want the sorted list to appear? --> Is it possible to sort in same combo box?
If not can you help me the code to populate selected items in below text box in 4 rows.

If I select 5 records, would like to see 5 rows in below text box.
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
> "This will help when I have hundreds of records."


I see you are using a multi-select field but unless you are a programmer, this is a terrible thing to do because you will have to write code to process choices. Most developers don't use multi-select fields either.  While it might seem like a cool quick way to get started, they create a lot of work.  Read what I wrote about creating another table.
0
 
Sreeni KambalaAuthor Commented:
Storing the records in trainer profile table, column name COURSE_NAME.Please verify.
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
you are using a multi-select field -- much better to use a related table.
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
Please re-read my previous comments -- I may have edited them after you read them.  thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.