Combo Box Multiple choice order

Roo Murray

New member
Local time
Today, 22:18
Joined
Aug 26, 2010
Messages
8
Hi,

Within a form I have created I have a combo box that allows for multiple picks/choices. The choices made are then transferred to a text box. All is fine so far :)

What I want to happen is the order of the text box is to be based on the order that the choices that have been checked within the combo box. At the moment it places them in alphabetical order. Is it possible to do this?
 
If you have a Multi-select Combobox I assume you're running Access 2007 or 2010. Prior to these versions Comboboxes did not natively have this ability, and the workaround I used then should do exactly what you want.

First off, go into Properties - Other for your Combobox and change the Multi Select Property to None.

Now use this code in the AfterUpdate event for your Combobox:
Code:
Private Sub YourComboBox_AfterUpdate()
 If IsNull(Me.YourTextBox) Then
   Me.YourTextBox = Me.YourComboBox
 Else
   Me.YourTextBox = Me.YourTextBox & ", " & Me.YourComboBox
  End If
 End Sub
Just replace YourComboBox and YourTextBox with the actual names of your controls.

Linq ;0)>
 
Thanks - That works a treat. & yes it is 2007.

I would still be interested if there is a way of using the multiple check box in order though? :o
 
There's no way that I know thst's native to Access.

I suppose you could assign the selections to an array and then sort the array, then assign it to the textbox.

Or do the same thing except assign the selections to a table, have a query/SQL statement to sort the values in the table, then read it back into the textbox. You'd then have to delete everything from the table to set it up for the next time you used the combobox.

And I have to tell you, that's way too much work to create, to begin with, and too much processor time to run over and over again!

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom