J
James S. Rice
How do I programmatically retrieve the date that a field
in a record in a recordset was last changed?
in a record in a recordset was last changed?
Joe Fallon said:Jet does not support triggers so it cannot be done at the datbase level.
You have to ensure users never use tables or queries to change data.
They *have* to use your forms if you want this to work.
Just code the AfterUpdate (or is it BeforeUpdate) event of your form to add
this piece of information "behind the scenes" whenever the record is
modified.
Me![txtRecordUpdated]=Now()
--
Joe Fallon
Access MVP
James S. Rice said:I don't keep the recordset open longer than necessary.
I have a Date field in my table named RecordUpdateDate,
but I currently manually enter a date in this field when I
update any field in the record. Is there a way to set the
field value to the current date automatically whenever any
field in the record changes?
-----Original Message-----
Jet does not support triggers so it cannot be done at the datbase level.
You have to ensure users never use tables or queries to change data.
They *have* to use your forms if you want this to work.
Just code the AfterUpdate (or is it BeforeUpdate) event of your form to add
this piece of information "behind the scenes" whenever the record is
modified.
Me![txtRecordUpdated]=Now()
--
Joe Fallon
Access MVP
I don't keep the recordset open longer than necessary.
I have a Date field in my table named RecordUpdateDate,
but I currently manually enter a date in this field when I
update any field in the record. Is there a way to set the
field value to the current date automatically whenever any
field in the record changes?
.
James S. Rice said:Worked perfect. Thank you.
-----Original Message-----
Jet does not support triggers so it cannot be done at the datbase level.
You have to ensure users never use tables or queries to change data.
They *have* to use your forms if you want this to work.
Just code the AfterUpdate (or is it BeforeUpdate) event of your form to add
this piece of information "behind the scenes" whenever the record is
modified.
Me![txtRecordUpdated]=Now()
--
Joe Fallon
Access MVP
I don't keep the recordset open longer than necessary.
I have a Date field in my table named RecordUpdateDate,
but I currently manually enter a date in this field when I
update any field in the record. Is there a way to set the
field value to the current date automatically whenever any
field in the record changes?
-----Original Message-----
A recordset is an in memory object.
How long do you keep yours hanging around?
If you mean a table, then I have to ask - do you have a
field where you
store that information?
A Date field named Updated or LastUpdated is normal.
Access does not track this information for you.
--
Joe Fallon
Access MVP
"James S. Rice" <[email protected]>
wrote in message
How do I programmatically retrieve the date that a field
in a record in a recordset was last changed?
.
.
is< correct.
Kevin Witty said:"Before update" or "After update": boy that question has caused me
huge heartaches over the years, so say nothing of "On Exit"! And no
book I've ever read or Help I've found has been any help.
I think I can say confidently that if you want to change the contents
of another bound field in a form depending on the contents of the
field you're changing, you should use "After update". "BeforeUpdate"
will give you an error. (i.e., on "AfterUpdate", change the
"ModifiedDate" field.)