Results 1 to 4 of 4
  1. #1
    Beginner72 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Dec 2016
    Posts
    12

    Using Windows Environment Variable in Hyperlinks


    Does anyone know if you can express a windows environment variable in a hyperlink? In my case, I store documents on OneDrive and have a hyperlink that can be used to open those files. Instead of setting the hyperlink address to "c:\users\user\onedrive\....", could I set the hyperlink to "%userprofile%\onedrive" so that these files could be accessed on multiple computers running the same front-end regardless of the computer user name.

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Have you tried it?

    IIRC you can't use the Environ function in sql statements or hyperlinks.
    Save the result as a variable and use that instead in your hyperlink
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    Beginner72 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Dec 2016
    Posts
    12
    Quote Originally Posted by ridders52 View Post
    Have you tried it?

    IIRC you can't use the Environ function in sql statements or hyperlinks.
    Save the result as a variable and use that instead in your hyperlink

    Thanks for your response. I did find something else that may help.

    https://answers.microsoft.com/en-us/...3-198eadcdc569

    It is good to know that I cannot use environment variables in SQL or hyperlinks.

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Good to know that my recollection was correct
    Use a variable or UDF instead
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

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

Similar Threads

  1. Replies: 1
    Last Post: 05-11-2018, 10:11 AM
  2. Replies: 13
    Last Post: 06-12-2012, 09:52 PM
  3. Replies: 12
    Last Post: 02-09-2012, 02:27 PM
  4. Replies: 13
    Last Post: 07-18-2011, 10:05 AM
  5. Replies: 3
    Last Post: 07-15-2010, 05:53 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