Results 1 to 8 of 8
  1. #1
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494

    Hyperlink string doesnt open file

    I have a table has two fields: CompanyLocation , FileName



    I have a form that uses and unbound field to create a file path string

    ="file:///s:/My Folders/" & [CompanyLocation] & "/" & [FileName]

    In the form it looks like file:///s:/My Folders/My Company One/This Is My File.doc

    I then set this to hyperlink in the form but when i click on it nothing happens.

    When i copy the link it gives me and paste it into Windows Explorer it works fine.

    Thanks for any help

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Try

    s:/My Folders/My Company One/This Is My File.doc

  3. #3
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494
    That does the same thing. Both work if you copy the result of the link and paste it in Windows Explorer but neither of them will open the link from within the Access form.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862

    Use VBA then

    In a dbl click or click event place

    Code:
    ControlName.HyperlinkAddress = "s:/My Folders/My Company One/This Is My File.doc"
    Just make sure you get the name of the control that is associated with the event before .HyperlinkAddress

  5. #5
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494
    All of the hyperlinks are generated from the database so I can't enter it direct.

    What I was able to do is create a continuous form which displays all the hyperlinks associated with that record and then put a button next to each item with the code Application.FollowHyperlink Me.FileURL (FileURL is the name of the unbound field that holds the file path)
    However, this doesnt seem to work if I put it in that fields on click event.

  6. #6
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    You have a couple options. I don't like displaying hyperlinks (the actual path). So, I would hide that control and place something else there. Maybe a button or even a text box. You may have a text box that represents what the hyperlink is for/to. Like a file name or file description that the User is familiar with.

    What you can do is....
    In the click event, assign a string variable the hyperlink value. The hyperlink is the textbox so you just make your string = textbox. Then assign the string variable to the control with the click event.

    Code:
    Dim strLink As String
    strLink = Me.ControlWithPath.Value
    Me.ControlName.HyperlinkAddress = strLink
    THis will work in a continuous form because the act of the user clicking a control will set focus on that record.

  7. #7
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494
    cool, works great ,thanks

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Glad to hear!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 22
    Last Post: 05-06-2013, 11:39 AM
  2. Open Access DB via a Hyperlink
    By Kirsti in forum Access
    Replies: 0
    Last Post: 09-06-2012, 04:45 PM
  3. open hyperlink in form - using VB
    By ender in forum Programming
    Replies: 1
    Last Post: 02-17-2012, 04:14 AM
  4. Hyperlink to open a form
    By accessnewb in forum Access
    Replies: 12
    Last Post: 07-27-2011, 07:33 PM
  5. Replies: 2
    Last Post: 01-14-2008, 12:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums