MS Access CurrentUser() Function

The CurrentUser() function in MS Access provides a simple way to retrieve the name of the currently logged-in user for the database.



CurrentUser(): Definition and Usage

This function is particularly useful for security-related tasks, auditing, or adding user-specific information to database records. It's especially handy when you need to identify who is making changes or accessing data in your database.

Syntax

The syntax is very straightforward; it doesn't require any arguments:

Syntax

CurrentUser()
      

Example

Retrieving the Current User

This query demonstrates how to use the CurrentUser() function to obtain the current database user's name.

Syntax

SELECT CurrentUser();
      
Output

YourUserNameHere  (Replace with your actual username)