CurrentUser Function

Description

You can use the CurrentUser function to return the name of the current user of the database.

For example, use the CurrentUser function in a procedure that keeps track of the users who modify the database.

Syntax

CurrentUser

Remarks

The CurrentUser function returns a string that contains the name of the current user account.

If you haven't established a secure workgroup, the CurrentUser function returns the name of the default user account, Admin. The Admin user account gives the user full permissions to all database objects.

If you have enabled workgroup security, then the CurrentUser function returns the name of the current user account. For user accounts other than Admin, you can specify permissions that restrict the users' access to database objects.

The following example obtains the name of the current user and displays it in a dialog box.

MsgBox("The current user is: " & CurrentUser)