label/text box showing last update date and time?

  • Thread starter Thread starter Ezra
  • Start date Start date
E

Ezra

I have a form that has a update tables button which runs a
query that grabs ODBC data from another database. I am
looking to add a label or text box that will display the
date and time of the last update. Is there a way to do
this?
 
If I set it to Now() will it not change anytime anyone
opens the form? I am wanting it to be static unless
someone pushes the update button.
 
Not sure about your ODBC data source, but for Access (JET) tables you have
to create the field to store this information.

Add a field named (say), "UpdatedOn" to your table.

In the form where changes are made, add this code to the BeforeUpdate event
of the form:
Private Sub Form_BeforeUpdate()
Me.UpdatedOn = Now()
End Sub
 
Back
Top