Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time Stamp

Status
Not open for further replies.

id10t

MIS
Feb 16, 2001
37
0
0
US
Is there a way I can have on the form when it was last edited?

Thanks for the help!!!
 
When the record or when the form itself was last updated?

Joe Miller
joe.miller@flotech.net
 
The record is what I am looking for.
 
You need a field in your table that stores the record to store the date, in the BeforeUpdate event of the form place this code to update the date. I usually call the field updated, so here's the code:
[tt]
'Update time/date record changed to Date()
If Me.Dirty Then
Updated = Date
End If
[/tt]
I myself prefer to put in the date and time:
[tt]
'Update time/date record changed to Now()
If Me.Dirty Then
Updated = Now
End If
[/tt]

The code inspects the form and if a change has been made, updates the field [Updated] to the system date/time. Now just put a field on your form showing the [Updated] field and I would disable it so the users can't modify it.

HTH Joe Miller
joe.miller@flotech.net
 
Thanks for the time and detail you put into this I am going to try it out right away.
 
OK,

I make a form, put in all the tables, put in some data to make sure the database is working right.

Made a table called updated, put it on the form. Not sure if the table needed any special formating.

Went to properties, went BeforeUpdate, Code Builder.

Typed in

If Me.Dirty Then Updated = Date
End If

Try changing some of the data on the tables in the form and the updated table does nothing at all. Tryed it in AfterUpdate and some other things.

What am I doing wrong?
 
Make a field called update in the table storing the record itself, not a table called udpated.

Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top