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!

Last modified date 1

Status
Not open for further replies.

Buj123

Programmer
Jan 5, 2004
96
US
Hello,
I have a textbox in a form which will have the current date. But in future if user want to change a record then that filed should show up that date, so it should always hold last modified date. HOw to set that?
 
Use the before update event of the form to assign the value to the control. The event fires whenever you're saving the record (make it hidden, so the users can't interfere with it).

[tt]me!txtLastModified=date[/tt]

Roy-Vidar
 
Thank you Roy.
But its not working. Its not adding the current date t new records and also when i go to perticular record and change some thing in it, then also its not updating the existing date with this new modified current date.
 
So you have a control on the form that's bound to a date field in the forms recordsoucre (ModifiedDate?). You update this control in the forms before update event, and it doesn't work? What does it do?

Be carefull with field and control names, .LastModified is a property of the recordset, and shouldn't be used as neither field nor control name.

What errormessages are you getting?

Roy-Vidar
 
Thank you Roy. It did worked for New records, its adding current date for new record and for existing record its releting the existing date in that filed but not updting it with current date
 
Hey Roy,
I got it, it is working. The only problem is its not working for the old data that i have. But it is working on all records which i am entering after i wrote the event.
Thanks a lot. Star for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top