View Full Version : Date and Time Stamp


mancko
04-17-2002, 01:44 PM
I am currently working on a simply database to update information from surveys. Unfortunately, we've discovered those giving us the surveys are less than reliable and we have ended up entering info onto the form more than once for the same entry.

What I'd like is some kind of date/time stamp that will appear on the main table each time the entry is updated. That way, if we see on the form that it was updated the day before, we'll know to double check the surveys. I'd like for this to happen automatically, but it could also be a button if necessary.

Any help would be great,

Cheers

DBL
04-17-2002, 02:02 PM
If you only wanted to keep the last updated date/time you could use the OnDirty event of the form. Put an Updated field in the table and add it to the form. On the OnDirty event of the form put

Me.[UpdateFieldName] = Now()

mancko
04-17-2002, 02:50 PM
I'm sorry, but either "Me." means something I'm supposed to enter for my own form, or it's a command my version of Access (97) doesn't understand. I keep getting a "The object doesn't contain the automation object 'Me'."

Does Me. = something else, or am I just not getting it?

Cheers

Pat Hartman
04-17-2002, 07:09 PM
Open the form in design view. Call up the form properties box. Press the ... button at the right edge of the BeforeUpdate event. Enter the statement that DBL suggested after changing "UpdateFieldName" to the name of the field in your table.

"Me." refers to the currently opened form or report and can only be used from within a form or report code module.

If your form is based on a query, be sure that you have updated the query to include the new date/time stamp. You may need to delete the query name from the form's recordsource and re-add it to force Access to refresh the form's field list.