Share via

current user expression

Anonymous
2013-10-04T11:41:53+00:00

I'm trying to make a field in a table have the default value of the current user, so we know who created the record.  I thought it would be CurrentUser(), but that's not working.  I'm sure it's something simple that I'm missing.  Please help.

Thank you!

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

10 answers

Sort by: Most helpful
  1. ScottGem 68,830 Reputation points Volunteer Moderator
    2013-10-04T13:43:38+00:00

    Hmm, So just putting =CurrentUser in the Default value of the control doesn't work?

    What does happen?

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2013-10-04T13:21:33+00:00

    It returns by username that I am logged into the database with.

    Was this answer helpful?

    0 comments No comments
  3. Tom van Stiphout 40,211 Reputation points MVP Volunteer Moderator
    2013-10-04T13:09:04+00:00

    Hit Ctrl+G to go to the Immediate window. Enter:

    ?CurrentUser

    and hit enter. What does it return?

    If "Admin", use the function Scott referenced.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2013-10-04T12:45:04+00:00

    I'm trying to pull the username of the person logged into the database - it has user-level security.  Should I still use the function you referenced?

    Was this answer helpful?

    0 comments No comments
  5. ScottGem 68,830 Reputation points Volunteer Moderator
    2013-10-04T12:37:00+00:00

    This depends on how you identify the current user. I think CurrentUser() only works if you are using ULS.

    If you are trying to pick up the currently logged in Windows user ID. Then use this function:

    http://access.mvps.org/access/api/api0008.htm

    Was this answer helpful?

    0 comments No comments