Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Dec 2006
    Thanked 0 Times in 0 Posts

    nicks continuing newbie questions... (2003)

    Hopefully, this is the last of the questions, lol...

    I want to put a date/time stamp on a record when I save it, whcih can be displayed on a form, or on a report. This needs to be the date/time that the record was first saved on - and mustn't change if any ammendments are made. Ideally, I'd like to save any subsequant ammendment dates as well, to produce an audit trail. Is this all possible?

    Thanks again...


  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Crystal Beach, FL, Florida, USA
    Thanked 40 Times in 39 Posts

    Re: nicks continuing newbie questions... (2003)

    Easy. Just add a Date/Time field to your table, and call it something like "DateTimeAdded". Set the DefaultValue to: Now()
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: nicks continuing newbie questions... (2003)

    To store the create date and last modified date (and time) of a record:

    Open the table in design view.
    Add two date/time fields: DateCreated and DateModified.
    Set the Default Value property of the DateCreated field to <code>Now()</code>

    On the form used to enter/edit date, put code in the Before Update event of the form:

    Private Sub Form_BeforeUpdate()
    Me.DateModified = Now
    End Sub

    This will only save the last time the record was saved. If you want an audit trail, see <post:=320,697>post 320,697</post:> for a simplistic approach, and see Allen Browne - Creating an Audit Log for a more complete solution.

Posting Permissions

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