label/text box showing last update date and time?

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?
 
G

Guest

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.
 
A

Allen Browne

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top