Solved

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

Posted on 2009-03-29
11
1,926 Views
Last Modified: 2012-05-06
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...

0
Comment
Question by:xsysys
  • 4
  • 3
  • 3
  • +1
11 Comments
 
LVL 11

Expert Comment

by:mildurait
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.
0
 

Author Comment

by:xsysys
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
 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 ....
 
0
 
LVL 11

Expert Comment

by:mildurait
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.
0
 
LVL 75

Assisted Solution

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

http://www.peterssoftware.com/dd.htm

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.

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

mx
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

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

mx
0
 

Author Comment

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

Author Comment

by:xsysys
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?
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 75 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.
0
 
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 !

mx
0
 
LVL 11

Expert Comment

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

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now