Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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

Posted on 2009-03-29
Medium Priority
Last Modified: 2012-05-06
  I have a listbox in a form wherein the items are retrieved from sqlserver database using Access project file..

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.


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...

Question by:xsysys
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 3
  • +1
LVL 11

Expert Comment

ID: 24016159
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.

Author Comment

ID: 24016258
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
It is not working for me... I will go through the code and check why?
If you have any other views, please ....
LVL 11

Expert Comment

ID: 24016267
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.
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 150 total points
ID: 24016386
If you want to DnD between two list boxes this will do it - including updating the tables on either side!

I have this and it's awesome.  You can also DnD between text boxes ... even if they are on different forms!  And a whole lot more.

LVL 75
ID: 24016390
Basically, you can DnD between any two objects that can accept text.

LVL 75
ID: 24016400
You can download the demo and check it out.


Author Comment

ID: 24016415 - I have already checked this one. As this is not for free of cost, I am not interested.............

Author Comment

ID: 24016483
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?
LVL 85

Accepted Solution

Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 225 total points
ID: 24016816
The closest you'll get is the MS article you found earlier. There is no other implementation that comes even close to that of Peter's Software. Note that a search for "drag drop ms access" returns several hits from other discussion groups with sample, downloadable databases. You might consider reviewing some of those to see if someone has enhanced the MS code.
LVL 75
ID: 24020608
"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 !

LVL 11

Expert Comment

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question