Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="https://stackoverflow.com/a/8702074/6884">ray023's answer</a> is basically correct, but one addition:</p> <p>At least on my machine (Win 7 Home Premium 64 bit, Access 2000 installed), both<br> <code>Environ("ProgramFiles")</code> and<br> <code>Environ("PROGRAMFILES(X86)")</code> </p> <p>...return the same folder, <code>C:\Program Files (x86)</code>.</p> <p>To get the "non-x86-folder" (<code>C:\Program Files</code>) on my 64 bit Windows, I need to use <code>Environ("ProgramW6432")</code>.</p> <p><a href="http://accesstips.wordpress.com/2010/02/15/get-developer-power-with-the-microsoft-access-vba-environ-function/" rel="nofollow noreferrer">Here's another link</a> about the <code>Environ</code> function, including code how to list all environment variables (that's how I found <code>ProgramW6432</code>).</p> <hr> <p><strong>EDIT:</strong></p> <p>As I already said in a comment, I just tested it on my other machine as the results seem to depend not only on the operating system, but on the installed MS Office version as well:</p> <p>This machine runs on Win XP SP3 32-bit, and Access 2000 is installed:</p> <p><code>Environ("ProgramFiles")</code> returns <code>C:\Programme</code>.<br> <em>(that's "Program Files" in German - I'm in Germany and my Windows is in German)</em> </p> <p><code>Environ("PROGRAMFILES(X86)")</code> and <code>Environ("ProgramW6432")</code> return an empty string.</p> <p>--> So the safest way to determine the "x86 folder" (no matter if on Win XP or Win 7) seems to be <code>Environ("ProgramFiles")</code>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload