Multi-Select Combo Box - auto alphabetizing

Copper Contributor

Help!  I have a mulit-select combo box called [PaymentMonth] and in it I list out the months of the year, January- December.  When the user clicks on the months they want to have appear in the [PaymentMonth] combo box, it will put it in alphabetical order.  I would rather it retain the order of the list.  For example, if the user selects April, May June, the Combo box shows "April, June, May" and I want it to say "April, May, June".  It is important because it is being passed to a report that will be used as a memo and it will be odd to read the months out of chronological order.

Thank you, L

7 Replies

@LibbyFred 

The problem here is that you want the sequence to be based, not on the month name, but on the month order, i.e. January is the 1st month, February is the 2nd month, etc.

 

A true "alphabetical" sort, is going to put February ahead of January because "F" falls before "J" in the alphabet.

 

The solution will be to use TWO columns for the combo box. One for the Names and one for the sequence numbers. Apply the sort to the number field. Set the width property of that column to 0" so it doesn't actually display in the combo box.

@LibbyFred 

 

On a different note, there is no multi-select property for a Combo Box. Only List Boxes support multi-select.

@George Hepworth 

 

Thank you George!! 

 

So, to clarify, I have a field called [PaymentMonth] and I set it up to look up values from a list box that pulls from a lookup table I created with two columns:  [MonthName] and [sortNum].   I have the list sorted by [sortnum] so that the list appears in chronological order when you pull down to make the selection.  However, once the selections are made, the [PaymentMonth] field that stores those multi-values then alphabetizes the results..for example....  

 

The list box pull-down looks like this:

January 1

February 2

March 3

April  4

...and so on.

 

Say a user checks,  March and April from the list box, then the data that appears in [PaymentMonth] looks like this:  "April, March".  I want that to appear in chronological order, so "March, April".  

 

Any thoughts on that?

 

Thanks,

Libby

 

@George Hepworth 

 

Yes, sorry "list box" not "combo box"

@LibbyFred 

 

Yes, two thoughts.

 

First, I abhor Lookup Fields in tables. This is just one of the many reasons for that. But that aside, my original advice remains.

@George Hepworth 

So it is actually set up as a look up field in a data entry form that is designed to look like a table (user request).  Does that make a difference.

@LibbyFredSorry, I misread your previous statement. You referred to a "field", which I interpreted to be the field in the table, not the control on the form.

 

Yes, my original suggestion would apply. Two columns in the list box. One for the Month Name, the other for the Month Number. Sort on the second column but make it 0" wide so it is not visible to the user.