F
forestville
I want a date field that automatically changes whenever any field in a record
changes.
How do I do this?
changes.
How do I do this?
Allen Browne said:Access has no triggers, so cannot do this at the engine level.
However, if all changes are made through a form, you can use the
BeforeUpdate event of the form to write the date and time into your field:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me![NameOfYourDateTimeFieldHere] = Now()
End Sub
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
[email protected] said:I want a date field that automatically changes whenever any field in a
record
changes.
How do I do this?
KARL DEWEY said:You also might consider using a history table that records all changes
instead of last one. Link history table to your key field. If using
logons
you can capture who done it.
Allen Browne said:Access has no triggers, so cannot do this at the engine level.
However, if all changes are made through a form, you can use the
BeforeUpdate event of the form to write the date and time into your
field:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me![NameOfYourDateTimeFieldHere] = Now()
End Sub
"[email protected]"
<[email protected]>
wrote in message
I want a date field that automatically changes whenever any field in a
record
changes.
Allen said:Access has no triggers, so cannot do this at the engine level.
However, if all changes are made through a form, you can use the
BeforeUpdate event of the form to write the date and time into your field