• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3410
  • Last Modified:

Drag & Drop files from explorer into an MS Access Form?

I would like to be able to create a form that populates a table with the filenames and paths of files that are dragged and dropped into one of the the form's controls.

I've seen examples of how to facilitate drag & drop between text-based controls withing access, or from menu items or between list drop down boxes...  but that is not what I need.

I need to be able to drag a NON-MS-Access object (a file in a folder) onto a form and have the form populate with the attributres of the file.

Does anyone know if this is even possibe?
If so,how??

Thanks!
0
cef_soothsayer
Asked:
cef_soothsayer
3 Solutions
 
Jillyn_DCommented:
Hi cef_soothsayer,

I've never seen a drag-and-drop done, but if you don't get an answer to that, you could certainly open an explorer window through Access and allow the users to select files by double-clicking them.  I've done this for selecting db's to compact and repair, but I don't see why you couldn't just capture the file name and path.

Good luck!
~Jillyn
0
 
cquinnCommented:
There is example code here that works using API calls:

http://www.mvps.org/access/api/api0032.htm
0
 
cef_soothsayerAuthor Commented:
cquinn,

I saw that earlier when googling, but couldn't get it to work.  The AddrOf() function is not included and the refered to download is writtenfor Excel and will not compile in access.

JillynD,

Good idea.  However, these files are coming from email and I'd actually like to drag & drop them in and have MS Access place them in a particular folder and rename them then put the new file/path into the fields of the source table for the form.

Thanks.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
As others have said, Access doesn't really do drag-n-drop. There are some ActiveX controls which may allow you to do this, but you'll still have to write the VBA code to manipulate the files after moving them to your folder.

I use Sky Software's Explorer controls in one of my Access projects. I can drag/drop files from outside Access into other folders, but I can't drop them onto native Access controls. The controls do expose a LOT of events/properties, so you may be able to work with them.

http://www.ssware.com/
0
 
cef_soothsayerAuthor Commented:
I still dont have a "good" answer to this, but I've created a work around so dont need it anymore.
I'll split the points.
Thanks.
0
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
I don't agree with the C grade; the correct answer was presented to you (i.e. Access doesn't provide drag-and-drop functionality) and while it may not have suited your needs, it _was_ the right answer and therefore deserves, at the very least, a B grade.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now