Forum Discussion
Schulleitung Attinghausen
Sep 20, 2016Copper Contributor
Username from Office-Account with VBA (Access2016)?
I want to read the username of the current logged in Office account in MS Access 2016 with VBA (not Windows or network username). The logged in user appears indeed in the Office2016 applications res...
Phil_Linell
Aug 26, 2020Copper Contributor
Hi I was looking for something similar and came across this excellent explanation:
https://www.youtube.com/watch?v=pJL1CCfvf7s
Public Function GetUserName() As String
GetUserName = Environ("Username")
End Function
Hope it helps
Phil
- Aug 26, 2020You should never use Environ values as they can easily be spoofed!
https://www.devhut.net/2018/04/12/vba-recognize-user-get-username/