Locate file, copy to another location, then create hyperlink to it

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a database in Access 2003. I have a table with a field set to
HYPERLINK which I want to use to point to files. I need a macro which will
prompt the user with the option to browse for a file ... when they select the
file it will then prompt them for a date and will make a copy of their file
to another directory (the same one in which the database is stored), giving
it the same file name with _<date>.??? afterwards - then it will create a
hyperlink to the new file and place it in the table.

Is this possible in Access and if so, can anyone please tell me how to do
it? I have very little experience of Access and little experience of VBA.
 
Sentinel,

This is beyond the scope for a macro to handle. However, you should be
able to do it in a VBA procedure, although it might be a bit challenging
if you haven't had much experience with VBA.

You can see code at http://www.mvps.org/access/api/api0001.htm which you
can use to return the name of a file selected by browsing. Once you
have that, you can use a string variable to reconstruct the file name to
include the date, and then use the FileCopy statement to write the copy
to the required place. You can use CurrentProject.Path to give you the
directory of the database you are using. Good luck.
 
Thank you Steve for your help, unfortunately I wouldn't even know where to
start with this code. I know nothing about programming ... I can create
relational databases and can work within Access to an extent but that's about
it.

I was kind of hoping there would be something I could just copy and paste,
then change the variables myself (table name etc).

Many thanks nonetheless for your prompt answer.


- David
 
Back
Top