Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    17

    Unanswered: Retrieving a username and placing it in a table

    I need to retrieve the username of a current access user and place it in a table for future use, does anyone know how I can accomplish this?

    Thanks in advance!

  2. #2
    Join Date
    Nov 2002
    Posts
    10

    Re: Retrieving a username and placing it in a table

    There are 2 ways to get the user name of the current user:

    Dim userName as String
    userName = Environ("USER_ID")

    OR

    userName = CurrentUser

    the Environ function will actually give you the name of the user logged in to the computer. CurrentUser is an access function which will give you the username which logged into Access.

  3. #3
    Join Date
    Oct 2003
    Location
    Roanoke, Va
    Posts
    445

    Smile Re: Retrieving a username and placing it in a table

    Originally posted by Owen34
    I need to retrieve the username of a current access user and place it in a table for future use, does anyone know how I can accomplish this?

    Thanks in advance!
    The Application object has a CurrentUser Property that will return the

    name of the current user.

    There's a couple ways to add the current user to a table. It depends on

    when you want to do it and how often.

    I used to use this in an Error Record table that logged when and where

    the error occurred and who logged the error. It helped me to debug the

    application when I wasn't around. This action was done in a standard

    module that had an error handling routine that all errors were filtered

    through.

    That was the when and how often for me.

    Hope this helps.

    Gregg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •