Results 1 to 7 of 7
  1. #1
    zipaway is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    May 2014
    Posts
    53

    Code doesn't add hyperlink address

    I have the following code:



    Code:
    rstTable("Link").Value = "C:\Program\test.xlsx"
    This updates my "link" field with the new hyperlink. The hyperlink address is missing though so you can't click the link.

    What code would allow me to change the address part of the hyperlink field?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    What is the Data Type of your field named, "Link"?

  3. #3
    zipaway is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    May 2014
    Posts
    53
    Quote Originally Posted by ItsMe View Post
    What is the Data Type of your field named, "Link"?
    the data type is a hyperlink.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Hyperlink strings have a specific format. Review http://www.allenbrowne.com/casu-09.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.

  5. #5
    zipaway is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    May 2014
    Posts
    53
    Quote Originally Posted by June7 View Post
    Hyperlink strings have a specific format. Review http://www.allenbrowne.com/casu-09.html
    Yes, I understand hyperlinks have 3 components. I can change the "text" of a hyperlink with code but not the actual "address".

    How could I modify a hyperlink entry address with code? Any help would greatly be appreciated.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Just include the # characters

    rstTable("Link").Value = "#C:\Program\test.xlsx#"

    Another link you might find of interest 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.

  7. #7
    zipaway is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    May 2014
    Posts
    53
    Quote Originally Posted by June7 View Post
    Just include the # characters

    rstTable("Link").Value = "#C:\Program\test.xlsx#"

    Another link you might find of interest http://allenbrowne.com/func-GoHyperlink.html
    Thank you so much! This worked, and thanks for the additional resources.

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

Similar Threads

  1. VBA to assign address to Hyperlink
    By jip911 in forum Programming
    Replies: 3
    Last Post: 08-02-2018, 04:33 PM
  2. Replies: 2
    Last Post: 08-22-2013, 12:02 AM
  3. Replies: 3
    Last Post: 01-17-2013, 10:43 PM
  4. Adding additional info to a hyperlink address
    By Greyhound in forum Access
    Replies: 4
    Last Post: 07-02-2012, 02:36 PM
  5. Replies: 4
    Last Post: 04-14-2012, 07:22 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