View Full Version : Record last updated field


vickiwells
06-30-2000, 07:08 AM
How can I make a field show the current date after any field in a record is updated? I found an article in the Microsoft Knowledgebase(Q96103) that was supposed to do it with a macro, but it doesn't work.

Pat Hartman
06-30-2000, 09:15 AM
It only takes one line of code. You don't need to bother with a macro.

In the BeforeUpdate event of the FORM:

Me.txtLastUpdateDate = Now()

LastUpdateDate is the name of the control for the bound last update field from your table.

vickiwells
06-30-2000, 10:07 AM
I'm getting the compile error "Method or data member not found" with the "txtDateModified" part of the code highlighted. DateModified is the name of my field, so what am I doing wrong?

Pat Hartman
06-30-2000, 08:44 PM
The name of the control should be different from the field's name in the query or table used as the recordsource for the form. So, for example, if your column name is LastUpdateDate, make the control name txtLastUpdateDate. Access gets confused when the control name and the column name are the same.