Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I code 'Drag & Drop' 4

Status
Not open for further replies.

Waynest

Programmer
Jun 22, 2000
321
GB
What is the best way to achieve 'drag & drop' functionality in Access XP?

I have a series of text boxes on a form. I want to be able to click on one, 'drag' the value by moving the cursor to another control, then release the mouse button to copy in the value.

Mouse Up/Down events don't seem to be much use, Mouse Down fires in the first text box but Mouse Up only fires in the same control, and not if the cursor has moved to a new text box like I want.

Pleeese Help

Thanks
Wayne
 
Several options that may work:
Have a look at

for simulated drag & drop or try :
which is a pretty impressive drag & drop routine, but is not free code.

hth

Ben

----------------------------------------------
Ben O'Hara

"Where are all the stupid people from...
...And how'd they get so dumb?"
NoFX-The Decline
----------------------------------------------
 
Ben,

That microsoft post has probably one of the most helpful dbs. It answers about 20 posts that I've seen on here.

So with that in mind, you get a star even though I didn't ask this question. I was bound to ask for one of those solutions one of this days.

I've done some drag and drop stuff. You can get close to Peter's software, or Mark's Software since I too have done dragging. I can send you a small db that shows how you can move objects around by capturing the x and y coordinants.
let me know if you want it.


Mark P.

Bleh
 
Ben,

That microsoft post has probably one of the most helpful dbs. It answers about 20 posts that I've seen on here.

So with that in mind, you get a star even though I didn't ask this question. I was bound to ask for one of those solutions one of this days.

Waynest,

I've done some drag and drop stuff. You can get close to Peter's software, or Mark's Software since I too have done dragging. I can send you a small db that shows how you can move objects around by capturing the x and y coordinants.
let me know if you want it.


Mark P.

Bleh
 
I have used drag and drop, generated using the guidance on the Microsoft site. It works very well between forms combining the mouse move with the SHIFT key.

Is there a way of adding a graphic to the pointer as it is "dragged" across the screen to show where the pointer is actually located at any point in time?

John R
 
I seeem to have a problem with the Microsoft example.

The Mouse Up event doesn't fire in the destination text box when I have 'dragged' across to it and release the left mouse button. It does fire & copy in the value if I left click in it.

Any ideas?

Thanks
Wayne
 
Wayne

I had this problem as well, which is why I resorted to using the SHIFT key in combination with the mouse. The code I have used to achieve this is:

Private Sub List0_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
DragStart Me
End Sub

Private Sub List0_MouseMove(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
DropDetect Me, Me!List0, Button, 1, X, Y

End Sub

Private Sub List0_MouseUp(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
DragStop
End Sub


where List0 is the source list box.

Does this help?

John R
 
John, thanks for the reply. Not sure, but I have a feeling my users will grumble about the shift key.

I'm finding this quite frustrating as it seems to me it should be a built in function.

I am wondering how the Microsoft example could ever work after reading this in the Access help:"

"If a mouse button is pressed while the pointer is over a form or control, that object receives all mouse events up to and including the last MouseUp event. "

Seems to me that makes the example nonsense?
 
Ben....Just Awsome! Thanks.

****************************
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III
MCSA, CNA, MCP, Network+, A+
w: robert.l.johnson.iii@citigroup.com
h: wildmage@tampabay.rr.com
 
Forget the MS code, the PetersSoftware solution is great!
I might even register its that useful.

Thanks to everyone who replied.

Wayne
 
I must admit, the PeterSoftware solution is pretty fantastic, that is a seriously talented coder! If I ever needed to use d&d I would certainly consider purchasing his code.

Ben

----------------------------------------------
Ben O'Hara

"Where are all the stupid people from...
...And how'd they get so dumb?"
NoFX-The Decline
----------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top