Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Jan 2004
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Copy file and then hyperlink

    Access 97.
    After the user clicks on a button to hyperlink a file and chooses the file to hyperlink, I want Access to first move that file to a pre designated sub folder (/Attachments) and then hyperlink to that location.

    This will save the user first copying the file to the desiganted folder and then creating the hyperlink.

    I have got a button that uses the Sendkeys to activate the hyperlink dialoge box, but need help to have access first copy then create the hyperlink.

    Neville.

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy file and then hyperlink

    Hi Neville,

    You can use the FileCopy statement to copy the file to a different locations. If you want to check whether the file exists at that location use the dir statement, if you want to remove the file use the kill statement.

    To open the file using known associations you can use the followhyperlink method:
    Application.FollowHyperlink strPathDoc, , True, False

  3. #3
    New Lounger
    Join Date
    Jan 2004
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy file and then hyperlink

    Thanks Bart

    I usually do something in Access about every six months, hence I an not into writing code. I can copy and paste code and change form names etc, to make it work but that is about my limit.

    If somebody could show me an example of the code that when called from a button, opens the file browse dialogue box so that the user can select the file (which could even be on a floppy) which is then automatically moved to the attachment sub directory and hyperlinked; I would be very appreciative.

    Neville.

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    The Netherlands
    Posts
    216
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Copy file and then hyperlink

    Hi,

    Glad I could help.
    For the file open dialog box you can take a look at The Access Web (http://www.mvps.org/access/toc.htm).
    Great stuff over there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •