I was requested to add a “Date/Time” field on a table to time-stamp a new record and / or any changes on the record (inputting from a input form). The new filed called “DateModified” was added onto the table (and an invisible “DateModified” text box on the input form as well); then I add the following code In the before update event:
Private Sub DATE_MODIFIED_BeforeUpdate(Cancel As Integer)
Me!DateModified = Now()
However, the “DateModified” has been time-stamped even though there is NO changes made to the record at all (I have just opened form to view the record and exit the form without any changes).
Please help me to correct the problem: That is, only set the “DateModified” to “Now()” value whenever there is any changes in the record or newly created record..