Update Record

  • Thread starter Thread starter Piggy
  • Start date Start date
P

Piggy

I have a problem with the following case:
I have 2 columns naming 'Value' and 'LastModifiedTime'
For the column 'LastModifiedTime', I have set the default
value to be the system date and time.
May I know if i ever update the record in the 'Value'
column, is there any method that it can automatically
update the system date and time in the
column 'LastModifiedTime'?

Thank you.
 
You can use the OnChange event in the Value field to
update the latest revision time:

Me.[LastModifiedTime] = Now()
 
I have a problem with the following case:
I have 2 columns naming 'Value' and 'LastModifiedTime'
For the column 'LastModifiedTime', I have set the default
value to be the system date and time.
May I know if i ever update the record in the 'Value'
column, is there any method that it can automatically
update the system date and time in the
column 'LastModifiedTime'?

Thank you.

There is no way to do this in a Table - tables have no usable events.

If you (as you should!) use a Form to edit the data in your table, you
can put code in the Form's BeforeUpdate event:

Private Sub Form_BeforeUpdate(Cancel as Integer)
Me.LastModifiedTime = 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

Back
Top