Results 1 to 4 of 4
  1. #1
    jaworski_m is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2015
    Posts
    25

    Default path for Insert hyperlink code

    Hello,


    I use the following code in the OnClick event to allow users to add a hyperlink.

    Code:
    'Opens hyperlink dialog
       On Error GoTo ErrEditHyper
       Me.link.SetFocus
       DoCmd.RunCommand acCmdEditHyperlink
       Exit Sub
    A pop-up windows shows up to insert hyperlink.

    QUESTION
    Is there a way to modify this code so that when window opens it alredy shows a default path ("x:\folder1\folder2\...\folder n"), so that user doesn't have to manualy go through all folders to the needed location ?

    This location is different than location of the database.

    Thank you for hints

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    I don't think can. Alternative is to not use the hyperlink dialog. Review http://bytes.com/topic/access/answer...default-folder

    Don't even need the 'hyperlink' type field. Filename (with or without full path) can be saved to a text field. Then to open the file: http://allenbrowne.com/func-GoHyperlink.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    jaworski_m is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2015
    Posts
    25
    Thank you reply.
    It seems it is what I need. However, I have a question to the code.

    Code:
    strHyperlinkFile = Mid$(varItem, InStrRev(varItem, "\") + 1) & "#" & varItem
    Why is the application of "$" in "MID" function?
    The code works also well without "$" character.

    I have been looking for explanation but without success.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Here is best explanation I can find https://msdn.microsoft.com/en-us/lib...(v=vs.90).aspx
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Default Hyperlink Text
    By mrmims in forum Forms
    Replies: 4
    Last Post: 07-07-2015, 04:17 PM
  2. Insert hyperlink - ensure absolute path
    By jaworski_m in forum Programming
    Replies: 1
    Last Post: 02-04-2015, 11:39 AM
  3. Replies: 5
    Last Post: 10-28-2013, 08:09 AM
  4. how to insert a hyperlink?
    By markjkubicki in forum Programming
    Replies: 1
    Last Post: 09-16-2010, 07:37 AM
  5. Use of CurrentProject.Path in export code
    By gg80 in forum Programming
    Replies: 1
    Last Post: 08-02-2010, 08:51 PM

Tags for this Thread

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