Results 1 to 3 of 3
  1. #1
    angelrodz is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2014
    Location
    Madison, Alabama
    Posts
    1

    Tracking users by username and date/time stamp to determine when a user logs into the db.

    I want to track users by username and date/time stamp to determine when a user logs into the database. I also want to keep a users log. When the user logged in it will be displayed on the screen. I am using Access 2013. The idea is to determine when was the last time anybody looged into the database and also keep a log of everyone.

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    7,986
    I send the object (form, table) to this routine that logs the person. Put it in any event trigger.
    (the tLOG table has a [timestamp] field with the default = NOW()

    Code:
    Public Sub Post2Log(pvObj)
      'Timestamp is in table field default = now()
    Dim sSql As String
    Dim vElaps, vUser
    
    DoCmd.Hourglass True
    vUser = Environ("Username")
    sSql = "INSERT INTO tLog (APP,Obj,USER) values ('" & CurrentDb.Name & "','" & pvObj & "','" & vUser & "')"
    DoCmd.RunSQL sSql
    DoCmd.Hourglass False
    End Sub

  3. #3
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,899
    If you were having a specific stumbling point then I expect someone would be able to help you. Is there some single element that you cannot implement?
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

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

Similar Threads

  1. Date/Time Stamp on barcode input form
    By computersnack in forum Access
    Replies: 3
    Last Post: 04-30-2014, 07:11 PM
  2. Column history - date and time stamp
    By Hatye in forum Access
    Replies: 5
    Last Post: 11-15-2013, 01:26 PM
  3. Replies: 3
    Last Post: 12-10-2012, 05:14 PM
  4. Date and Time Stamp
    By zoooza84 in forum Access
    Replies: 2
    Last Post: 08-06-2011, 04:53 AM
  5. Replies: 4
    Last Post: 01-30-2010, 05:22 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
  •  
Tech Forums: Microsoft Office Forums