SetValue and CurrentUser()

G

Guest

I’ve inherited a database that auto populates a field by a macro that I don’t
quiet understand how it works. The macro name is “input by†and here's its
definition.

condition: [Forms]![Log_Form]![Input By] Is Null
[Forms]![Log_Form]![Date Input] Is Null
action: SetValue
SetValue
StopAllMacros
item: [Forms]![Log_Form]![Input By]
expression: CurrentUser()
item: [Forms]![Log_Form]![Date Input]
expression: Now()

I’m not sure how Access uses CurrentUser() to populate the field. Any
explanation will be greatly appreciated! (Or point me to where I can find
more info.)

Thank you so much in advance.
 
G

Guest

Currentuser is a built-in access function that refers to the user currently
login into the database using a workgroup file (mdw file), if the database is
open using the standard access workgroup (system.mdw) and no security is
setup, the value returned is "Admin", but if security is setup then it will
refer to the mdw file for the user logon name,
 
S

Steve Schapel

Dgreen,

Here is a quote from Access Help:

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

If you haven't established a secure workgroup, the CurrentUser method
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 method
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top