How I Exported an Attachment fields data to a folder
At the time, (maybe I didn’t do enough research), I probably also underestimated the quantity of scanned documents the customer would have and the impact on the database file size.
From the start, the database was split into a Front End and a Back End.
At inception, the Back End was about 3MB in size. it is over 660MB in size and growing with every scanned document.
I started doing research online to figure out how I could export of the scanned documents from the Attachment field, save them to a folder, and then add their location to a new table and field so the customer could still access them.
It’s important to note that each scanned contract is associated with a customer order and I would need to ensure that whenever my customer went to a customer’s order, they would see only those scanned contracts.
I never found in one place a “How To Export Attachments” article so I decided to summarize here what I did in the hope that it helps others that need to reverse stored documents/pictures/etc.
Maintaining the relationship to thelocation in the database are now being saved was critical.
Before you begin, make sure you back up your Back End data as well as your Front End. Also, please hold the feedback on how I named my fields and/or tables. I’m comfortable with it and it works for me. Yes, I know sometimes I need to use brackets on my field/table names.
One sample code that I used was from the Microsoft Access 2010 Programmer’s Reference manual. I modified the code slightly and it is shown below:
Thank you for taking the time to report an issue.
What's wrong... Please write below.
It does not open with the Excel Macro in order to run. I was able to transfer the data to Excel and I was able to open the Macro Excel but when it runs, it runs on itself not on the exported file.
As of right now all of my Transferspreadsheets are in ACCESS Macro, not in VBA and they are being exported as expected. I just need to add a RunCode using Module that will coincide with the Transferspreadsheets as it gets exported to the desired folder and run it and save.
I am pretty confident that this could beaccomplished but needs to make sure the Excel Macro is working on the exported file not on itself.
On a form, I can see a record’s information, including two hyperlink attachments (one links to a folder, the other to another folder or file on the local computer). I click the link and each opens, no issues.
What I would like to do:
-Click a command button that opens an email (I have that down),
-The coding would then look at the current record, identify the two attachment links, pull the file from the attachment and add it to the email from my local machine (the crazy part).
-To add, I’d like the files to be zipped to the attachment (the crazier part).
-For example, the file is stored at C:\Users\Steve21nj\Desktop\ Items\Email\MGA-12-60000
The reasoning: We will need to send audit reports based on the pdf’s in the folder (the attachments). I’d like to eliminate user error by not attaching the correct file/folder.
I have seen the ability to push the hyperlink itself on the email, but not the hyperlink’s data (file) into the email. Also, I have read about the hatred for hyperlink fields, is there abetter alternative for the above?
I would like to be able to double click on the subfolder and open them up as if I had gone to the directory/folder.
My problem: I recently gathered some data in the attachment fields in the development copy of the database and wanted to transfer the additions to the production table. The update query came back with a message to the effect that you can't use an attachment field in an update query.
Has anyone else encountered this problem? If so, what is the workaround? VB or manual re-entry of the data
If so, what is the workaround? VB or manual re-entry of the data?
Data from my access forms are normally exported to word templates. Once I click on a cmdbutton, the data is exported using bookmarks and opens the word file. Users then can choose if to save it and where to save it.
I would like to avoid this step. I would like to place a second cmd button which directly exports data the word file and saves it into a specific folder (let's say it could be C:\myforms\myname
Can anyone help with this? I believe the procedure will need some input box so that users can assign the name to the file (as they are templates) before saving it