View Single Post
  #7  
Old December 28th, 2009, 11:03 PM posted to microsoft.public.access.tablesdbdesign
Clifford Bass via AccessMonster.com
external usenet poster
 
Posts: 150
Default How do I save the date a record was last modified in Access 2003

Hi,

I find setting the default values for date/time fields in Access to Date
(), Now() or Time() to be highly inaccurate because the value is set when the
new row is displayed, not when data is initially being entered and not when
it is actually saved. So if I go to a new record on 12/28/2009 at 11:50 pm,
but do not actually start entering anything until 12/29/2009 at 12:15 am and
do not actually save it until 12/29/2009 at 12:45 am, it will save with a
creation date of 12/28/2009 and a creation time of 11:50 pm. Which is just
plain wrong. So the use of the Before Insert event to set it at the time of
starting the record is a better solution. Likewise the use of the Before
Update event to set it at the time of saving. It would depend on what you
are defining as the creation date/time. The default values would be useful
for situations where you are importing data; then you would not have to set
the creation date/time explicitly. Of course, the whole issue can be
complicated further by an inaccurate computer clock. So I could be entering
data on a computer with a different time zone setting and it would provide
that time zone's date/time. Hmmm... If you use a default value say of Now()
on a column in a back-end database on the network, does Access use that
network computer's clock? Or the front-end computer's clock? I presume the
front-end computer's.

For anything where it is critical to know the correct date/time, you
need to use a database system that will use your server's clock and that will
set the values by that clock regardless of how or from where the record is
being created.

And here is another issue when the correct date/time of creation is
critical. It has to be set up so that that date/time can never be changed
once it has been set.

Things to think about,

Clifford Bass

David W. Fenton wrote:
They each demostrate how to capture the DOC (Date of Creation)
and
the DOLE (Date of Last Edit) for each record.


Date of Creation requires only a default value, no?


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/200912/1