A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do you add an audit date to field (ie record created xx/xx)



 
 
Thread Tools Display Modes
  #1  
Old August 26th, 2009, 04:16 PM posted to microsoft.public.access.gettingstarted
ko779
external usenet poster
 
Posts: 1
Default How do you add an audit date to field (ie record created xx/xx)

I'm trying to catch the date in my Access db of when a new record is created,
would like to capture the name as well.

How do you do it??
  #2  
Old August 26th, 2009, 04:25 PM posted to microsoft.public.access.gettingstarted
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default How do you add an audit date to field (ie record created xx/xx)

One approach is to add another field to the table to hold something like
[UpdateDate]. Then, in your form (you ARE using a form, right?!), you can
set the value of that field to today's date (or today's date/time). The
AfterUpdate event for the form (one of the many good reasons to be using
forms, not working directly in the tables) would be a convenient place to
set that value.

Regards

Jeff Boyce
Microsoft Office/Access MVP

"ko779" wrote in message
...
I'm trying to catch the date in my Access db of when a new record is
created,
would like to capture the name as well.

How do you do it??



  #3  
Old August 26th, 2009, 04:34 PM posted to microsoft.public.access.gettingstarted
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default How do you add an audit date to field (ie record created xx/xx)

The date for a new record is easy. Make the default value of a date field in
the table either Date() - which is just the date - OR Now() which is the date
and time.

Who did it is a little more complicated. Below is a link to a function that
will pull it. However you will need to run this function in a form on
something like the Before Insert event. If someone enters data directly into
the table, it will not work.

http://mvps.org/access/api/api0008.htm
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"ko779" wrote:

I'm trying to catch the date in my Access db of when a new record is created,
would like to capture the name as well.

How do you do it??

  #4  
Old August 26th, 2009, 06:16 PM posted to microsoft.public.access.gettingstarted
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default How do you add an audit date to field (ie record created xx/xx)

Jerry

I've used that approach too, but I have 'long-winded' customers who start a
new record and walk away. By waiting 'til they 'close' the new record, I
get a more accurate date/time value...

But maybe you've been blessed by 'prompt' customers!g

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Jerry Whittle" wrote in message
...
The date for a new record is easy. Make the default value of a date field
in
the table either Date() - which is just the date - OR Now() which is the
date
and time.

Who did it is a little more complicated. Below is a link to a function
that
will pull it. However you will need to run this function in a form on
something like the Before Insert event. If someone enters data directly
into
the table, it will not work.

http://mvps.org/access/api/api0008.htm
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"ko779" wrote:

I'm trying to catch the date in my Access db of when a new record is
created,
would like to capture the name as well.

How do you do it??



  #5  
Old August 26th, 2009, 07:11 PM posted to microsoft.public.access.gettingstarted
John Spencer
external usenet poster
 
Posts: 7,815
Default How do you add an audit date to field (ie record created xx/xx)

You can use both approaches at the same time.

Default value = Now() will work well if you ever import records and if you
really want to now approximately when the record was committed using the
form's after insert event can overwrite the default value.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Jeff Boyce wrote:
Jerry

I've used that approach too, but I have 'long-winded' customers who start a
new record and walk away. By waiting 'til they 'close' the new record, I
get a more accurate date/time value...

But maybe you've been blessed by 'prompt' customers!g

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Jerry Whittle" wrote in message
...
The date for a new record is easy. Make the default value of a date field
in
the table either Date() - which is just the date - OR Now() which is the
date
and time.

Who did it is a little more complicated. Below is a link to a function
that
will pull it. However you will need to run this function in a form on
something like the Before Insert event. If someone enters data directly
into
the table, it will not work.

http://mvps.org/access/api/api0008.htm
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"ko779" wrote:

I'm trying to catch the date in my Access db of when a new record is
created,
would like to capture the name as well.

How do you do it??



  #6  
Old August 26th, 2009, 07:58 PM posted to microsoft.public.access.gettingstarted
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default How do you add an audit date to field (ie record created xx/xx)

Sweet!

Jeff

"John Spencer" wrote in message
...
You can use both approaches at the same time.

Default value = Now() will work well if you ever import records and if you
really want to now approximately when the record was committed using the
form's after insert event can overwrite the default value.

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Jeff Boyce wrote:
Jerry

I've used that approach too, but I have 'long-winded' customers who start
a new record and walk away. By waiting 'til they 'close' the new record,
I get a more accurate date/time value...

But maybe you've been blessed by 'prompt' customers!g

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Jerry Whittle" wrote in message
...
The date for a new record is easy. Make the default value of a date
field in
the table either Date() - which is just the date - OR Now() which is the
date
and time.

Who did it is a little more complicated. Below is a link to a function
that
will pull it. However you will need to run this function in a form on
something like the Before Insert event. If someone enters data directly
into
the table, it will not work.

http://mvps.org/access/api/api0008.htm
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


"ko779" wrote:

I'm trying to catch the date in my Access db of when a new record is
created,
would like to capture the name as well.

How do you do it??



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.