Results 1 to 3 of 3
  1. #1
    rooster is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2012
    Posts
    8

    Get Username using macro

    I am working on a system with an Excel front-end, using an access database (connecting using DAO)
    I am trying to add logging (description of changes in a 'logs' table) using access macros, and need to add current users username.
    I know you can do this a VBA function, but these don't seem to run when i edit the db from Excel VBA. Is there someway to get username using a Access macro? Or get VBA code to run?

    thankful for any help...

  2. #2
    R_Badger is offline Knows a few tricks
    Windows XP Access 2003
    Join Date
    Feb 2012
    Location
    Suffolk, UK
    Posts
    262
    I don't really know much about excel, and to be honest I'm not sure why you would want to use excel as a frontend, however, access can do it, a quick google: access get username (first link in list)
    http://www.techonthenet.com/access/modules/username.php
    Provides a vba function to get the current users login.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,963
    This works for me in Access/VBA

    VBA.Environ("USERNAME")

    Yes, type it exactly as shown.

    Why Excel frontend?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 14
    Last Post: 08-17-2015, 02:32 AM
  2. username&password
    By metokushika in forum Access
    Replies: 1
    Last Post: 11-16-2011, 03:13 AM
  3. Username help needed...
    By dotti1966 in forum Access
    Replies: 3
    Last Post: 05-18-2011, 10:12 AM
  4. Recording Username
    By Juan4412 in forum Forms
    Replies: 9
    Last Post: 02-01-2011, 11:15 PM
  5. Username For Sharepoint
    By is49460 in forum SharePoint
    Replies: 0
    Last Post: 10-08-2010, 05:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums