torstai 30. elokuuta 2007

CurrentUser Function

In Access, the CurrentUser function returns the name of the current Access user. In a secured database, this would be the name of the user who has logged in. If the database is unsecured, this function would return Admin (the default account) as the name of the user.

The syntax for the CurrentUser function is:

CurrentUser()

VBA Code
The CurrentUser function can be used in VBA code. For example:

Dim LUser As String
LUser = CurrentUser()


In this example, the variable called LUser would now contain the name of the user currently logged into the Access database.

SQL/Queries
You can also use the CurrentUser function in a query.

Ei kommentteja: