Creating a Global Date/Time Stamp feature for forms 
Author Message
 Creating a Global Date/Time Stamp feature for forms

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



Tue, 14 Dec 1999 03:00:00 GMT  
 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



Wed, 15 Dec 1999 03:00:00 GMT  
 Creating a Global Date/Time Stamp feature for forms

Dorman,

Thanks a lot!  That seems like a nice, simple solution.  I knew I was
making it too complicated...

Thanks again!!

Rob Haber



Wed, 15 Dec 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Compare date in form with date/time in form with date/time in database

2. Date and Time Stamp for a Field Being Modified

3. Return File Date Time stamp

4. Access 7.0/8.0 (Win95) - How to retrieve a file's date/time stamp

5. (Q) Help with SelectDir and Date/Time stamp

6. Help! Object date/time stamp screw-up

7. How to get Server date/time stamp?

8. Saving date/time stamp of text file

9. Misleading Date/Time Stamp on mdb

10. Modification to Time and Date stamp needed

11. Time/Date stamp

12. Insert Time/Date stamp

 

 
Powered by phpBB® Forum Software