Results 1 to 6 of 6
  1. #1
    sk88 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    183

    simple tracking

    So I am interested in knowing who created the record and who changed it.



    I followed the examples from one of the website but I can't seem to get it work.

    I have added the below fields to my table and query:
    CreateBy Text
    CreateDate DateTime Default value =Now()
    ModBy Text
    ModDate DateTime

    and I added the codes to the current and before update events of the form
    Code:
    Private Sub Form_BeforeUpdate(Cancel As Integer)
     ModBy = Environ("username")
        ModDate = Now()
    End Sub
    Code:
    Private Sub Form_Current()
     If Me.NewRecord Then
            CreateBy = Environ("username")
        End If
    End Sub


    This is what was stated in the examples but it is not working.
    Any idea anyone?

    Thanks!

  2. #2
    sk88 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    183
    To add to that.. I have a start form which asks for Login and Password before they could enter to the form above.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    What exactly happens? Error, wrong data?
    This isn't very helpful
    but it is not working.

  4. #4
    sk88 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    183
    Quote Originally Posted by orange View Post
    What exactly happens? Error, wrong data?
    This isn't very helpful

    Sorry, not wrong data nor does it gives me error message. It is just not saving the Createby/Username to the table/query.

    The only thing that is saved is CreateDate

    Maybe I did not link it properly?

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    What is the Table name involved? You have to explicitly update the Table, unless you are using a bound form.

  6. #6
    sk88 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    183
    Quote Originally Posted by orange View Post
    What is the Table name involved? You have to explicitly update the Table, unless you are using a bound form.
    It is a bound form. The form is linked to a table called 'METRICS'
    and the username and password is in a table called 'tblEmployees'

    Maybe I should use unbound form instead?

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

Similar Threads

  1. date tracking
    By coogami in forum Access
    Replies: 5
    Last Post: 10-21-2011, 03:20 PM
  2. Simple Fund Tracking Database
    By tday in forum Database Design
    Replies: 2
    Last Post: 10-10-2011, 03:56 PM
  3. Order Tracking
    By aladrach in forum Access
    Replies: 9
    Last Post: 07-01-2011, 02:04 PM
  4. Employee Tracking
    By nycon in forum Access
    Replies: 6
    Last Post: 10-27-2010, 05:42 PM
  5. tracking
    By mugziegumz in forum Access
    Replies: 0
    Last Post: 11-20-2008, 10:11 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