Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2003
    Location
    HongKonger@NewYork
    Posts
    9

    Question Unanswered: Tracking of login records

    I am required to design a databse function to automatically track the date and user(login name who logged in did the last updating of a particular record. Should I design an extra table with each existing table to host all the login records or achieve the purpose in some other forms? May anyone suggest any appropriate method to do so? Thank you!

  2. #2
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    quickest method is to create a logtable within the db and call that table
    tbl_Log

    that has the following fields

    Luser
    Ldate
    LAction


    behind every save button (if you have them or edit button)

    dim db as database
    dim rst as recordset
    set db = currentdb
    set rst = db.openrecordste("ltbl_log")
    dim x
    x = forms!formname!custID '(or the record id from the form)
    rst.addnew
    rst!luser = currentuser()
    rst!ldate = date()
    rst!laction = "Saved record number " & x
    rst.update

    rst.close
    set rst = nothing

    make sure that in the vb window
    tools/references has Microsoft DAO 3.5 or 3.6 checked

  3. #3
    Join Date
    Jul 2003
    Location
    HongKonger@NewYork
    Posts
    9

    Question

    Thank you for your reply.
    Sorry for not having specified that I'm using Access 97 to manage a shared database on the network at office and there is no Visual Basic installed in all computers. Then can I still use this method? where can I set "tools/references has Microsoft DAO 3.5 or 3.6 checked" Thanks!


    quickest method is to create a logtable within the db and call that table
    tbl_Log

    that has the following fields

    Luser
    Ldate
    LAction


    behind every save button (if you have them or edit button)

    dim db as database
    dim rst as recordset
    set db = currentdb
    set rst = db.openrecordste("ltbl_log")
    dim x
    x = forms!formname!custID '(or the record id from the form)
    rst.addnew
    rst!luser = currentuser()
    rst!ldate = date()
    rst!laction = "Saved record number " & x
    rst.update

    rst.close
    set rst = nothing

    make sure that in the vb window
    tools/references has Microsoft DAO 3.5 or 3.6 checked [/SIZE][/QUOTE]

  4. #4
    Join Date
    May 2003
    Location
    Dallas
    Posts
    817
    Provided Answers: 5
    if they have 97 they have builtin VBA support for this code

    to test this

    put a button on the form

    in design mode go to the property sheet for the button
    select the events tab
    go to the "OnClick' event
    click the three buton (ellipse) to the right of this line and chose code if you do not default to the vb window

    your blinking cursor will be the starting line of the event

Posting Permissions

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