Getting User Name Using WScript

tlc1974

Registered User.
Local time
Today, 02:49
Joined
Aug 4, 2003
Messages
21
Hi,

I want to incorporate this script:

Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "Domain = " & WshNetwork.UserDomain & Chr(13) & "Computer Name = " & WshNetwork.ComputerName & Chr(13) & "User Name = " & WshNetwork.UserName

into my access database so everytime a record is changed/added/deleted etc it will log the user name. When I add this code to a module it says object required - what object does it require?

Thanks in advance
 
If you need an Audit Trail, there have been some excellent examples posted.

Do a search and see if anything suits your needs.

Col
 
Code:
Public Function ComputerName()
    MsgBox Environ("computername")
End Function

Public Function UserName()
    MsgBox Environ("username")
End Function
environvariables.zip
 

Users who are viewing this thread

Back
Top Bottom