By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

I want to locate a file, copy it to another folder, and hyperlink

P: 76
Hello all,

I have a button that opens a browse for window, to allow you to find a file and create a hyperlink to that file. This is then placed in a text box. The code I use is:
Expand|Select|Wrap|Line Numbers
  1. Private Sub browse_Click()
  2.  
  3.     Me.[Hyperlink].SetFocus
  4.     On Error GoTo browse_stop
  5.     RunCommand acCmdInsertHyperlink
  6. browse_stop:
  7.  
  8. End Sub
  9.  
I would like to expand this a little. I want to locate a file, no matter where, copy it to a specified folder, and then create a hyperlink to the copied file. I would also like to do more then one hyperlink if at all possible.

Thanks in advance,

Brian Smith
Apr 15 '08 #1
Share this Question
Share on Google+
6 Replies


P: 23
Browsing for Files have a look at this link:
http://msaccesstips.com/2006/10/file...msaccess.shtml

Hyperlinks to an External File can be made by setting the Object's (Command Button, Label etc.) Hyperlink Address Property with External File Path.
Apr 15 '08 #2

P: 76
This is what my code does already, I am wanting the button to not only do this, but to copy the file no matter where it is, and paste it in the folder on the network where all my hyperlink files go. Then hyperlink to it. I also want to expand it to do more then one hyperlink.
Apr 15 '08 #3

JKing
Expert 100+
P: 1,206
This is what my code does already, I am wanting the button to not only do this, but to copy the file no matter where it is, and paste it in the folder on the network where all my hyperlink files go. Then hyperlink to it. I also want to expand it to do more then one hyperlink.
The FileCopy command will allow you to copy and paste a file from a source to a destination. An error will occur if the file is open.

Here's an example of using the FileCopy statement.

Expand|Select|Wrap|Line Numbers
  1. FileCopy "C:\Jared.txt", "C:\Test\Jared.txt"
  2.  
C:\Jared.txt is the Source
C:\Test\Jared.txt is the Destination

Hope that helps,

Jking
Apr 15 '08 #4

P: 76
That sounds good, but my button only opens a hyperlink browse window. I want to be able to open a browse window, select the file, then make a copy of it and plce it in another folder, then I want it to create a hyperlink to it.
Apr 15 '08 #5

JKing
Expert 100+
P: 1,206
That sounds good, but my button only opens a hyperlink browse window. I want to be able to open a browse window, select the file, then make a copy of it and plce it in another folder, then I want it to create a hyperlink to it.
Okay,

So you want the user to be able to select a file to be copied from a browse file menu.

Do you want the user to be able to choose a destination path in a similar fashion? Or do you want all files to be copied to the same destination?
Apr 17 '08 #6

P: 76
yes that is exactly right. I want the file to go to a specified location. But the only other problem I will have is that the text box only allows for one file to be hyperlinked. If there is a way to do multiple hyperlinks that would be great, but if not, I would like to not only hyperlink the file but be able to copy and hyperlink a folder.

Brian
Apr 17 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.