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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need field for last modification date of form 1

Status
Not open for further replies.

SColbert

Technical User
Joined
Sep 25, 2003
Messages
49
Location
US
I need a field on a form to return the form's last modification date. Assistance appreciated!
 
When you say the "form's" last modification date, do you mean the last time the form was "designed"??? Or the last time a record, displayed by the form, was modified???

****************************
Only two things are infinite, the universe and human stupidity,
and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Sorry for the ambiguity - I need the last time a record, displayed on the form was modified.
 
You have to trap that. Create a date field called EditDate in your table, and place this code in your form's BeforeUpdate property;

Private Sub Form_BeforeUpdate(Cancel As Integer)

Me!ctlEditDate = Date

End Sub

That'll capture the date the record was LAST edited. Otherwise, you have to create an edit history table.

Hope this helps.

Jim DeGeorge [wavey]
 
Sorry..."ctlEditDate" is the name you should give the control on the report, pointing to the field "EditDate". You should also make this field VISIBLE=NO and LOCKED=YES, and set TAB STOP to NO.

Jim DeGeorge [wavey]
 
OKay....what you need to do is add a field to the table that stores the records....call it EditDate or something. Set the format to ShortDate, and then display this field on the form. On the form, I would set the enabled and locked property for the editdate field so the users cannot change it manually. The in the OnCurrent event for the form, I would check to see if the form is dirty, and if it is, I would set the EditDate to today's date.

****************************
Only two things are infinite, the universe and human stupidity,
and I'm not sure about the former. (Albert Einstein)

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Glad to have helped. Thanks for the star!

Jim DeGeorge [wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top