G
Guest
Hello. Is there a way to retrieve properties, such as the local machine
name, user logged on and group membership using VBA?
name, user logged on and group membership using VBA?
Allen Browne said:Computer name:
http://www.mvps.org/access/api/api0009.htm
Network user name:
http://www.mvps.org/access/api/api0008.htm
If you are using Access Security (system.mdw file), you can get the Access
user name as:
CurrentUser()
The user could be a member of more than one group, but if you want to know
whether they are a member of a particular group:
Function IsUserInGroup(strUser As String, strGroup As String) As Boolean
Dim varDummy As Variant
On Error Resume Next
varDummy = DBEngine(0).Users(strUser).Groups(strGroup).Name
IsUserInGroup = (Err.Number = 0)
End Function