I kept reading about Triggers and what I'm trying to do is I want a date change everytime I update a record so I know when the record has been updated.
In the before update event of the form, add some code that adds the timestamp to your control bound to a date/time field in the underlying recordsource:
[tt]me("txtModified").value=now[/tt]
Access doesn't support triggers, form events are the closest one gets;-)
Ok - the method above is often used when you have a hidden control on the form, and ensures there's no changes to the current record just by entering/viewing it.
Using techniques where a control is updatet only by tabbing thru has it's downsides
* if a user only clicks on those controls they want to update, the date will not be updated
* if a user only tabs thru the current record, or accidently clicks into this control, the date will be updated
Some events to try:
* on dirty event of the form - when a change is made
* in the on exit/on lost focus of the control
But, I think I'd keep one control unbound (the one for display puproses), and have a bound control invisible, to be updated by the forms before update event. Then populate the unbound control in the on current, and alter it in either the forms on dirty, or the other method described above, but that's just my view;-)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.