How to retrieve current signed-in user name of Access 2019 app

David Haycraft 1 Reputation point
2021-06-11T03:51:04.227+00:00

In a Windows 10/Access 2019 app, using VBA code, I need to retrieve the name of the current signed-in user .

The name I'm seeking is automatically displayed in the top row of the Access app’s main window. See attached screenshot.

Sadly, both Environ("Username") and CreateObject("WScript.Network").UserName just return the string value “user”.

104517-fig1.png

How can I retrieve the actual signed-in user name of my Access 2019 app?

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tom van Stiphout 1,696 Reputation points MVP
    2021-06-11T04:24:16.627+00:00

    I think that is not easy to do. Why is it important?

    It is easy to get the user as far as Access is concerned (almost always: "Admin") or as far as Windows is concerned (the username you signed on to Windows with (see https://www.devhut.net/2018/04/12/vba-recognize-user-get-username/ and others)), but the pretty name that Access is displaying is not easy.

    0 comments No comments