Results 1 to 7 of 7
  1. #1
    sunnyday is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    45

    Wink Audit trailing username from list of allowed users within an Access Database when user logs in

    Hi,


    I have a log in form where the user's log in ID and Login Name is extracted into navigation form. But I want to track who logged in and what changes were made when the user logs in. I do not want the environ username to be tracked. Is there a way how to pull up the users log in name into the Admin Page where the table for approved users are stated?

    Thanks
    sunnyday

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    They have a db login name different from their network login? If you have this login ID and name extracted to a form that always remains open, then it is available to do whatever you want when you want.

    Do you have an audit trail process in place?
    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.

  3. #3
    sunnyday is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    45
    Yes, their network login names are different. Yes I have tried using the environ username which can pull up their names into the logged table as well as their log in times which actually I dont want.
    Nope I have not created any audit trail yet.But have done the login form coding to pull up their loginID and names as well.
    Dim User As String
    Dim ID As Integer
    Dim CaseManager As String
    Dim LoginID As String
    If IsNull(Me.txtUserName) Then
    MsgBox "Please enter UserName", vbInformation, " UserName Required"
    Me.txtUserName.SetFocus

    ElseIf IsNull(Me.txtPassword) Then
    MsgBox "Please enter password", vbInformation, "Password Required"
    Me.txtPassword.SetFocus

    Else
    If (IsNull(DLookup("LoginID", "LogDetails", "LoginID = '" & Me.txtUserName.Value & "' And password='" & Me.txtPassword.Value & "'"))) Then
    MsgBox "Invalid UserName or Password!"


    Else
    LoginID = Me.txtUserName

    CaseManager = DLookup("[CaseManager]", "LogDetails", "[LoginID]='" & Me.txtUserName.Value & "'")
    UserLevel = DLookup("[UserType]", "LogDetails", "[LoginID]='" & Me.txtUserName.Value & "'")
    ID = DLookup("[InspectorID]", "LogDetails", "[LoginID]= '" & Me.txtUserName.Value & "'")

    DoCmd.Close
    If UserLevel = 1 Then

    'MsgBox "Correct LoginID or Password"
    DoCmd.OpenForm "Navigation form"
    Forms![navigation form]![txtLogin] = LoginID
    Forms![navigation form]!NavigationButton18.Enabled = True


    Forms![navigation form]![txtUser] = CaseManager

    Else
    DoCmd.OpenForm "Navigation form"
    Forms![navigation form]![txtLogin] = LoginID
    Forms![navigation form]!NavigationButton18.Enabled = False
    Forms![navigation form]![txtUser] = CaseManager


    End If


    End If
    End If
    End Sub
    Where navigationbutton18 is the Admin Page containing LoginIDs,Case manager names,Passwords and UserType -Admin/User

    Thanks

  4. #4
    sunnyday is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    45
    Yes their db login names are different. Since its in a network there will be more than concurrent users accessing it at the same time. I have already extracyed their names and Login IDs into the navigation form.But I havent split the databse for testing yet. So how is it going to track the users into the admin table.
    Please help

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    I am not sure what you want. Do you want to create a new record in Admin table every time user logs in? Do you just want to set value in field of existing record? I do the latter.

    Me.tbxUser = DLookup("UserInitials", "Users", "UserNetworkID='" & Environ("UserName") & "'")
    CurrentDb.Execute "UPDATE Users SET ComputerName='" & VBA.Environ("ComputerName") & "' WHERE UserInitials='" & Me.tbxUser & "'"
    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.

  6. #6
    sunnyday is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    45
    Sorry for the confusion. Well, I want to create a new record in Admin table every time user logs in.So that I know who logged in & at what time.I want the db name to be recorded and not the user's network name.
    Thanks in advance

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Did my examples help?
    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. Replies: 2
    Last Post: 11-25-2014, 09:21 AM
  3. Replies: 15
    Last Post: 03-28-2014, 07:29 AM
  4. How can I add username when user makes an update?
    By alexandervj in forum Access
    Replies: 14
    Last Post: 02-20-2014, 08:53 PM
  5. Replies: 2
    Last Post: 02-09-2013, 12:39 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