Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Cheltenham, Gloucestershire, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    date stamping changes to records ('97)

    I want to be able to track the date a record was last amended on a form (just that the record has been altered not necesarily identify a particular field) - but that people could still access and view records on the form without that triggering any date update.

    Can anyone help please?

    Thanks

    Roberta


    Roberta

  2. #2
    Star Lounger
    Join Date
    Dec 2001
    Location
    Birmingham, Alabama USA
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: date stamping changes to records ('97)

    Add a Date/Time field to the table. Include the newly added field to the recorset query the form is bound to. Add a new txbox control on your form and set the Control Source of the txbox to the newly added field. You can set the "Visible" property to False to hide the control from view.

    Use the form's "On Before Update" event to populate this new hidden txtbox.

    Private Sub Form_BeforeUpdate(Cancel As Integer)
    Me.YourControlName = Now()
    End Sub

    (change "YourControlName " to the name of the hidden txtbox)

    The "Before Update" event of the form only fires if you are currently on a "New Record" or if an "Existing Record" is altered.

    HTH
    RDH
    Ricky Hicks
    Microsoft MVP
    Birmingham, Alabama USA

Posting Permissions

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