Link to home
Start Free TrialLog in
Avatar of xsysys
xsysys

asked on

How to drag and drop items in a single listbox (Access 2007 project )

Hi,
  I have a listbox in a form wherein the items are retrieved from sqlserver database using Access project file..

Example:
Table1
------------
Column
Item_Description   Sort_Order
AAAA                       1
BBBB                       3
CCCC                      2

By default, the listbox items are sorted based on the Sort_Order column and shown to the user as below.

AAAA  
CCCC
BBBB      

I would like to provide the drag drop feature for my listbox so that user can sort the items easily in whichever order he wants.. Based on his order the Sort_Order column will be updated...

I want something similar to "Tab Order" form in Access 2007...

Avatar of mildurait
mildurait
Flag of Australia image

I'm pretty sure that you cannot drag and drop from a standard access listbox but I stand to be corrected.

You could however provide four buttons with images on them (dbl-arrow up) (arrow up) (arrow down) (dbl-arrow down) by default at disabled status.  The buttons would become active when a value is selected from the listbox, and each button would run it's own unique sql  to manipulate the values in the Sort_Order column.
Avatar of xsysys
xsysys

ASKER

Thanks for your quick reply. This is how I have already implemented....For user-friendliness I would like to go for drag - drop feature...
I am trying out the article
"How to simulate drag-and-drop capabilities in Access 2002" - Example 2
 from http://support.microsoft.com/kb/287642...
It is not working for me... I will go through the code and check why?
If you have any other views, please ....
 
Yeah I read that article too...
Maybe you should startout with the two listbox example and see if you can make that fly.
If you  can get that to work, you might be able to dynamically hide and show the two listboxes to make it look like one.
SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Basically, you can DnD between any two objects that can accept text.

mx
You can download the demo and check it out.

mx
Avatar of xsysys

ASKER

http://www.peterssoftware.com/dd.htm - I have already checked this one. As this is not for free of cost, I am not interested.............
Avatar of xsysys

ASKER

I downloaded the demo and checked. Drag-N-Dropper reorder listbox is the feature I want exactly. Can anyone help me how to do this without purchasing any tool?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
"Can anyone help me how to do this without purchasing any tool?"
If you can't spend $35 for an app that someone has spend 100's of hours developing, then you are left with doing it yourself.  If you look at the code it takes to make that happen - trust me, you don't even ... want to go there.

"Drag-N-Dropper reorder listbox is the feature I want exactly"
Exactly my point !

mx
Agree with mx and lsm on this one.
Stick with what you have or purchase a third party product.