Access 2007 paste into form and create hyperlink
Posted on 2010-01-06
I am trying to find a way to do the following:
I want a user to be able to either paste or drag and drop a document (pdf, jpg, doc, xls, etc)
from outside of Access to a textbox or similar control. On this event, Access should do the following:
-Create a new folder for the company name in the dbase parent folder if one does not exist.
-Create a new folder for the form number (unique value) if one does not exist.
-Copy the document from its location to the subfolder if it exists or after the subfolder is created.
-Ask the user what filename they want to assign to the copied document
-Save the doc as that filename
-create a hyperlink in the access form (again I see this as a textbox) with the name and a link to the saved document.
The user should be able to copy as many documents (within reason) into the form as they wish.
The names of the hyperlinks should appear in the textbox, seperated by commas, as in:
document1.doc, document2.pdf, document3.txt etc...
And finally, the user should be able to open these documents by clicking on the hyperlink.
Whew! I know how to accomplish the majority of the file manipulation via VBA but the Access functionality is new to me. I have included the entire idea for completeness and any help is greatly appreciated!