Results 1 to 4 of 4
  1. #1
    billmark is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Aug 2016
    Posts
    13

    Tracking Login and Logout

    Hi
    I want to keep track the login and out time of the users. After the users login in the login form, it goes to main form. I have the following codes in the Load event in the main form. After I add the code in RED, it doesn't work, no update in the tblLgInTime. qryLogInTime is an append query to the tblLogInTime.

    Please help how to fix.

    Code:
    Private Sub Form_load()
      Me.txtlogin = Environ("username")
      Me.txtFullName = DLookup("username", "tbluser", "[userlogin]='" & Me.txtlogin & "'")
    Code:
      Dim strDocName As String
      strDocName = "qryLogInTime"
      DoCmd.OpenQuery strDocName, acViewNormal, acEdit
    End Sub
    Regards
    Last edited by RuralGuy; 09-18-2016 at 04:01 PM. Reason: Formatted the code

  2. #2
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529

  3. #3
    billmark is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Aug 2016
    Posts
    13
    I've already created an audit trail for adding, deleting and revising the input form. What I am trying to record the logIn/Out time when they sign in the Login Form. Bases on my code, please direct.

  4. #4
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Not a lot of detail in your message - what exactly doesn't work (the code, the form, the query)? If you run the query from the navigation pane does it work correctly?

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

Similar Threads

  1. Replies: 8
    Last Post: 05-16-2016, 08:17 AM
  2. code for logout
    By rameshjctr in forum Programming
    Replies: 4
    Last Post: 04-20-2016, 10:24 PM
  3. Replies: 2
    Last Post: 04-17-2015, 10:59 AM
  4. Replies: 1
    Last Post: 02-17-2013, 06:54 AM
  5. login tracking
    By itsmemike in forum Access
    Replies: 8
    Last Post: 09-18-2010, 08:05 AM

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