Sort listbox by drag and drop

G

Guest

Hello,

Is it possible to sort a list box by dragging a line up or down the list?

I have a form that has all the information about a single truck, and in the
list box, I have a line for each delivery that truck is scheduled to do. I
would like to sort this list box manually in order to decide what order the
truck shuold make these deliveries.

thx

Baard
 
G

Guest

That is not going to work with a list box. I would suggest, instead, you use
a subform. Add a DeliveryOrder field to your table and include it in the
subform so the user can enter the order there.
 
G

Guest

hmmm..... a sub form would not really be practical with the form I am making,
but I think I found a pretty good way of doing this, that does not involve
drag and drop.

I have a hidden, unbound text box in the form that starts out with the value
one. When I double click a delivery in the list box, that record gets updated
with a position number equal to that in the text box. After each double click
in the list box, the number increases by one.

The list box is sorted by that position number, of course.

There is also a reset button if I would like to change the order of the
deliveries.

Any comments? Is this a too roundabout way of doing things?

Baard
 
G

Guest

I don't see any problem with that.

bvdahl said:
hmmm..... a sub form would not really be practical with the form I am making,
but I think I found a pretty good way of doing this, that does not involve
drag and drop.

I have a hidden, unbound text box in the form that starts out with the value
one. When I double click a delivery in the list box, that record gets updated
with a position number equal to that in the text box. After each double click
in the list box, the number increases by one.

The list box is sorted by that position number, of course.

There is also a reset button if I would like to change the order of the
deliveries.

Any comments? Is this a too roundabout way of doing things?

Baard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top