Setvalue with environ variables

ptenhet

New member
Local time
Today, 12:52
Joined
Jan 28, 2013
Messages
7
access 2007--I'm trying to use the setvalue to grab environ("username") to populate a form. Keep getting a "Function" error. Is this possible with the setvalue?
 
What you get using Environ() are the values of the environment variables. Note "variable". The default for Username variable is the username but the value is easily changed by the user.

Type this into a cmd window (not VBA) then see what Environ("username") returns afterwards.

Code:
Set username = anything

Better to get the actual information.
Code:
LoginName = CreateObject("wscript.network").UserName

MachineName = CreateObject("wscript.network").ComputerName
 

Users who are viewing this thread

Back
Top Bottom