Link to home
Create AccountLog in
Avatar of David_W_R
David_W_R

asked on

What Environment Variables are accessible within Access 2007 via VBA

I've just begun to explore how I can make the Environment Variables useful to my app, and the following code shows me my machine's Host and User...

Private Sub btnGetEnvVar_Click()

Dim Host As String
Dim User As String

Host = Environ$("computername")
User = Environ$("username")

MsgBox ("Host is: " & Host & " and User is " & User)

End Sub

Question iswhere's the reference list of the various accessible Environment Variables
or at least those commonly used?
ASKER CERTIFIED SOLUTION
Avatar of Micheal Hunt
Micheal Hunt
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of David_W_R
David_W_R

ASKER

Just what I needed.  Thanks very much.