Results 1 to 6 of 6
  1. #1
    FuseF16 Guest
    Windows 10 Access 2013 64bit

    Question Drag & Drop attachments in access form

    I'm new to Access 2013 (and access in general) and am looking for some advice and help. I have a form with several attachment fields. What I am looking to do is to find a way to drag and drop files to those fields (JPG, PDF, Doc, etc.), and have access automatically copy those files to a new directory and rename them based on other fields on the form (Index-Name-Descriptor). Any ideas on an easy way to do that? Any help or assistance would be greatly appreciated. Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    A little confused. If you are embedding file into attachment field, why do you need to copy and rename to a new directory?

    Access does not have intrinsic drag and drop. Only references I can find for drag and drop of external files involve ActiveX TreeView control.

    Copying a file is simple with FileCopy method.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    FuseF16 Guest
    Windows 10 Access 2013 64bit
    Let me reiterate that I'm new to Access and have never used it before. My understanding is that the attachment field in a table (filled by a form) is just a reference to where the file is located and not actually a copy of it. I've also read that putting all the files into the database is a bad idea because it gets big quickly, and makes it slow and prone to corruption or failure. Regardless, I want everything to get moved to locations and organized to make it easy to back up the files/database and figure out what database entry they are related to if I have to rebuild the database or retrieve only a single file.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Attachment field actually holds the file object and is not just a reference to external location. Which is exactly why loading lots of large files into table can quickly use up Access size limit.

    So you do not want to use an attachment field. Instead store the path name into a text field or a Hyperlink type field.

    Usual method when using a text field is VBA to open Windows FileDialog for users to select file. The selected file path/name can be used in the FileCopy method. Many examples of such code.

    Hyperlink type field has its own dialog window, however, VBA can be used to modify the hyperlink string.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    FuseF16 Guest
    Windows 10 Access 2013 64bit
    Ok, let me start over and see if someone can help teach me how to make this work. I have a database for say an inventory of items. To enter the data, I have a form. On that form I'd like to have several containers where a user can drag and drop a file (picture, PDF, document, etc). What I would like to have happen is the form to show a thumbnail of the file, copy and rename the file to a specific location based on other data in the form, and for the database to have a link to where each of those drag and drop attachments is located instead of putting the actual file into the database. Can anyone please help me figure out if this is even possible and how to make it work? Thanks.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Well, you asked for it, don't get mad at me when you lose your mind!

    Bing: Access drag and drop file name

    Review
    https://bytes.com/topic/access/answe...s-form-textbox
    https://bytes.com/topic/access/answe...op-field-files
    https://answers.microsoft.com/en-us/...e5fb28f?auth=1
    etc
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 09-19-2017, 09:49 AM
  2. Replies: 1
    Last Post: 09-11-2013, 01:22 PM
  3. Drag and drop images into form
    By togo in forum Access
    Replies: 7
    Last Post: 11-05-2012, 08:51 AM
  4. Replies: 9
    Last Post: 05-30-2011, 12:08 PM
  5. Drag N Drop example between 2 listboxes
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-30-2010, 10:10 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums