Solved Up and Down Buttons to Change Sequence

MattBaldry

Self Taught, Learn from the Forums
Local time
Today, 16:59
Joined
Feb 5, 2019
Messages
330
Hi all,

Does anyone have a sample code of Up and Down buttons to change the sequence of a list?

I have a table with a field [Sequence] which I will use to sort the order. It does not allow duplicates.

What I am after is a code for buttons so when an item is highlighted, if I click Up, it changes the Sequence field from 10 to 9, and this would then need to change the current 9 to 10, if that makes sense.

~Matt
 
Pretty sure @MajP had a class to do just that?
Search with his username.

Then again, there is Google

However his code would be a lot easier and cleaner. :)
 
i also have a demo for Bound Listbox.
 

Attachments

This has a lot of features. Also has features to support doing something with the sorted list.
 
I do it differently. When the lists get long, it is too easy to get lost when you use the drag and drop method. Look at the subform example. The sequence numbers are inserted either by 10's or 100's, I don't remember which and you can change it to leave whatever gaps make sense to you. Then, you can replace #500 with #150 to move it to between #100 and #200 without having to try to drag it there. When you run out of gaps or are finished, you can renumber the sequence to make it "neat" again:)

 
This looks perfect, but the download link does not work :(

~Matt
Just copy the link then? :(
This will take you to all the zip files


Look at the link on the page posted to see what zip file you need.
It downloaded fine for me, it opens and extracts fine, and the demo is as indicated.
 
Just copy the link then? :(
This will take you to all the zip files


Look at the link on the page posted to see what zip file you need.
It downloaded fine for me, it opens and extracts fine, and the demo is as indicated.
I tried that but it didn't work. But now it does. Possibly my browser playing up....

~Matt
 
Gina, the here link links to the zip file, but appears to do nothing?
 
Never mind, I got it and fixed it... and looks like I have quite a few links to fix so thanks for letting me know.
Thanks Gina,

And the download is exactly what I was after, so just need to integrate it into my form now.

~Matt
 
Never mind, I got it and fixed it... and looks like I have quite a few links to fix so thanks for letting me know.
Thank you Gina,

It works perfectly, and the code was easy to read and learn.

ListBox.png


Thank you for your help.

~Matt
 

Users who are viewing this thread

Back
Top Bottom