Printable Version of Topic

Click here to view this topic in its original format

UtterAccess Forums _ Access Forms _ List Ordered By Selected Items

Posted by: ocoutrun Jan 11 2017, 10:52 AM

Hi there

I need some help with listboxes and how to order by selected items.

Here's what I have:

List box one containing:

1
2
3
4
5

List box 2 gets items from first list box by user selecting them (multi select)

I need list box 2 to be order by what the user selects

IE user selects from listbox 1 in this order

5
3
1
2

Listbox 2 would be

5
3
1
2

Is there a way to do this?

Thanks

Posted by: theDBguy Jan 11 2017, 10:59 AM

Hi,

What do you have in the MultiSelect property: Simple or Extended?

Posted by: ocoutrun Jan 11 2017, 11:03 AM

listboxes set to Simple


Posted by: theDBguy Jan 11 2017, 11:27 AM

Okay, then. I would suggest to use the Click event of the Listbox to store the order of the selected items in a variable and then modify your code to use it when you move the selections to the second listbox.

Hope it helps...

Posted by: ocoutrun Jan 16 2017, 12:53 PM

Thanks DBGuy

I went with a little different idea. I'm using a temp table between the 2 listboxes for sorting. It will handle selected and deselected items and keep them sorted.

thanks for your help

Posted by: theDBguy Jan 16 2017, 01:21 PM

Hi,

Congratulations! Glad to here you found a solution. Good luck with your project.