date of last data change

S

Silvio

I have a table with 3 fields [DateIn] [Rates] and [LastModified]

DateIn default value it is set to Now() in the table

When a user enters a new record he is required to enter a Rate only. The
system will populate the filed DateIn automatically and at this stage the
LastModified field NOT have any value since the initial [Rate] has not been
modified yet.

Then, the user can open up a form and update the [Rate], if needed. This is
where I need to start to keep track of the DateModified only after the
initial Rate changes not the initial setup.

I tried to set me.LastModified = Now() in before update, after update, on
change, on dirty and nothing seem to work as I expect meaning the system
enter the LastModified date even on the initial entry (the same form is used
to enter new records). Any suggestion?
 
R

Rick Brandt

Silvio said:
I have a table with 3 fields [DateIn] [Rates] and [LastModified]

DateIn default value it is set to Now() in the table

When a user enters a new record he is required to enter a Rate only.
The system will populate the filed DateIn automatically and at this
stage the LastModified field NOT have any value since the initial
[Rate] has not been modified yet.

Then, the user can open up a form and update the [Rate], if needed.
This is where I need to start to keep track of the DateModified only
after the initial Rate changes not the initial setup.

I tried to set me.LastModified = Now() in before update, after
update, on change, on dirty and nothing seem to work as I expect
meaning the system enter the LastModified date even on the initial
entry (the same form is used to enter new records). Any suggestion?

BeforeUpdate

If Not Me.NewRecord Then
Me.LastModified = Now
End If
 
S

Silvio

Works great. Thank you!

Rick Brandt said:
Silvio said:
I have a table with 3 fields [DateIn] [Rates] and [LastModified]

DateIn default value it is set to Now() in the table

When a user enters a new record he is required to enter a Rate only.
The system will populate the filed DateIn automatically and at this
stage the LastModified field NOT have any value since the initial
[Rate] has not been modified yet.

Then, the user can open up a form and update the [Rate], if needed.
This is where I need to start to keep track of the DateModified only
after the initial Rate changes not the initial setup.

I tried to set me.LastModified = Now() in before update, after
update, on change, on dirty and nothing seem to work as I expect
meaning the system enter the LastModified date even on the initial
entry (the same form is used to enter new records). Any suggestion?

BeforeUpdate

If Not Me.NewRecord Then
Me.LastModified = Now
End If
 
J

Jan Baird

Jan Baird is out of the country until September 20. Every effort will be
made to respond to messages, but please be patient.
 

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