
Creating a Global Date/Time Stamp feature for forms
Rob, I would call the function from the AfterUpdate event of each form.
Afterupdate doesn't fire unless a change is made. It doesn't fire if a
change is made which is cancelled or undone. AfterUpdate doesn't fire on a
deletion so call a to the function/sub would be needed in the
AfterDelConfirm event.
The Function/Sub could be something as simple as:
Sub UDStamp(Value1, Value2, Value2, ...)
currentDB.Execute "INSERT INTO <tableName> (Field1, Field2, Field3, ...
)
VALUES (Value1, Value2, Value3, ...);"
End Sub
and called like:
UDStamp Value1, Value2, Value3, ...
dorman blackman
Quote:
> Hi, everybody
> I'm trying to create a global date/time stamp feature. It could be
called
> from any form in the MDB, and it would create a new record in a table
with
> date/time stamp (along with user name and some other info) every time a
> user edits, deletes or adds a record on a form. I've tried to work it
out
> using the RecordsetClone property and the LastModified property. I'm
> calling the function from the Timer event of the form (which I suspect is
> probably a mistake but I'm trying to avoid calling the code from several
> different controls and events of the form.) The code has to be called
when
> adding a record, deleting a record or editing an existing record.
> Any suggestions?
> Thanks!!!
> Rob