Results 1 to 4 of 4

Using Windows Environment Variable in Hyperlinks

  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
    ridders52's Avatar
    ridders52 is offline Long time standing
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    1,644
    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 (Mendip Data Systems), Website, email

    If this has helped, please click the star button and leave a comment

  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
    ridders52's Avatar
    ridders52 is offline Long time standing
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    1,644
    Good to know that my recollection was correct
    Use a variable or UDF instead
    Colin (Mendip Data Systems), Website, email

    If this has helped, please click the star button and leave a comment

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

Similar Threads

  1. Replies: 1
    Last Post: 05-11-2018, 09:11 AM
  2. Replies: 13
    Last Post: 06-12-2012, 08:52 PM
  3. Replies: 12
    Last Post: 02-09-2012, 01:27 PM
  4. Replies: 13
    Last Post: 07-18-2011, 09:05 AM
  5. Replies: 3
    Last Post: 07-15-2010, 04: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
  •  
Tech Forums: Microsoft Office Forums