Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2003
    Posts
    300

    Unanswered: User Id on each Detail Record?

    I want to be able to record in the detail record the Identity of the user that entered the record, for auditing purposes. There is no security setup, user ids, etc. but I was wondering if Access could grab the MS XP Computer name,, or something that would ID the user/

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    before someone else suggests environ (a bad bad bad idea) or even secur32.dll (a good idea, but more complicated that it needs to be), here's a simple idea:

    Dim wshNetwork As Object
    Dim strLogin as string
    Set wshNetwork = CreateObject("wscript.network")
    strLogin = wshNetwork.UserName
    Set wshNetwork = Nothing

    strLogin is now the "NT Login" of the user on your network.
    A is not going to grab it automatically for you - up to you to obtain the data and insert it in the table.

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    and you can also play with...
    wshNetwork.UserDomain
    wshNetwork.ComputerName
    wshNetwork.SetDefaultPrinter
    wshNetwork.MapNetworkDrive
    ...amongst many other things

    more about wsh here

    izy
    currently using SS 2008R2

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    or if you don't want to use wsh becasue your antivirus package goes ape you can try the API calls

    there are several functions in this bas module
    getcomputerid } does what it says onthe tin
    getuserid }
    haspermission (useergroup)
    -queries if the currentuser is a memebr of the specified user group. This code should be modified to use getuserid in place of currentuser()

    HTH
    Attached Files Attached Files

  5. #5
    Join Date
    Nov 2003
    Posts
    300
    Thank you izy. I will try this.

Posting Permissions

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