Drag Drop from Windows Explorer

  • Thread starter Thread starter hgupta2003
  • Start date Start date
H

hgupta2003

Guest
Hi All,
I have a form with a textbox where the user can type a filename. I want to add a functionality to the form where the user can simply drag-drop the file from a Windows Explorer, instead of typing it.

Any help in this regard would be greatly appreciated.

Thanks in advance

-hgupta
 
Welcome to the forum. You will learn a lot from this site once you figure out how to use the search function. I am not sure about dragging and dropping a file from Windows Explorer into Access but you can use a variety of methods to allow the user to "browse" for the file of their choice and you can capture their selection and use it to populate a field, open the file, etc.

Check out these APIs for calling the standard windows "File Open" and "Browse Folder" using VBA...

API: Call the standard Windows File Open/Save dialog box
http://www.mvps.org/access/api/api0001.htm

API: BrowseFolder Dialog
http://www.mvps.org/access/api/api0002.htm

HTH
 
Thanks ghudson for your reply. I already have a File Browse feature where the user can browse and select the file. I just thought it would be a cool and user-friendly feature if the user can just drag and drop from Windows Explorer.

I did use the search feature to find anything relevant already posted, but couldn't find anything :( .

Thanks again
-hgupta2003
 
You could populate a lsitbox or something to display the file system then have a read of drag and drop capabilities in access Here

Hope this Helps

Andy
 
Thanks Guys!!

Thanks for your help guys. Really appreciate it. I was on vacation the last 2 weeks, came back today morning, implemented it, and its working just fine.

Thanks again,
hgupta
 
Hi all.

Get a compile error "Sub or Function not defined" on the following statement (the AddrOf bit);

Sub sHook(Hwnd As Long, _
strFunction As String)
lpPrevWndProc = apiSetWindowLong(Hwnd, _
GWL_WNDPROC, _
AddrOf(strFunction))End Sub

Tried changing to AddressOf but to no avail. I'm running A2K. Any ideas?
 
Just wondering how you implemented Drag & Drop. I wanted to Drag & Drop, but not from one control to another. Rather, I would like to drag a file from Explorer and drop to my Image Control or Text Control. The Microsoft Technet/Support only teaches you how to drag & drop from an Access control to another. Any ideas?
 

Users who are viewing this thread

Back
Top Bottom