Determining When Table last had data entered

  • Thread starter Thread starter Gary Townsend \(Spatial Mapping Ltd.\)
  • Start date Start date
G

Gary Townsend \(Spatial Mapping Ltd.\)

Is there a property of the table or a way to determine when data was last
entered into a table?

Thanks
Gary Townsend
Spatial Mapping Ltd.
 
Well i think i found my answer i just had to change my search parameters. I
guess teh short answer is not unless i put in a field equivalent to a
timestamp.

Gary Townsend
Spatial Mapping Ltd.
 
Hi Gary,

Add these 2 fields to all your tables (I make them the last
2 fields.

DateCreated, date, DefaultValue = Now()
DateModified, date -- update on the form BeforeUpdate event

the best way to use the DateCreated field is to set a
default value of
=Now()
in the table design.

For Date Modified, make sure it is on your form (I put it in
the form footer and LOCK it). Then, use the Form
BeforeUpdate event to set the value

me.DateModified = now()

This will record when records were created and modified --
then you can write a program to search these fields of your
tables and return the tablename whose record was last changed.

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)
 
Thanks never thought of using the default value that way.

Gary Townsend
 
Per Gary Townsend (Spatial Mapping Ltd.):
Is there a property of the table or a way to determine when data was last
entered into a table?

I think you came up with it already.

I almost always have four fields at the bottom each tables field list:

CreatedAt [TimeStamp ]
CreatedBy [LAN UserID]
UpdatedAt
UpdatedBy
 
Is there a property of the table or a way to determine when data was last
entered into a table?

Not unless you put it there. Access does not record that information.

John W. Vinson[MVP]
 
you're welcome, Gary ;) happy to help

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)
 
Thanks, Pete ;)

sometimes I add CreatedBy and ModifiedBy ... I like your
shorter names

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)


(PeteCresswell) said:
Per Gary Townsend (Spatial Mapping Ltd.):
Is there a property of the table or a way to determine when data was last
entered into a table?


I think you came up with it already.

I almost always have four fields at the bottom each tables field list:

CreatedAt [TimeStamp ]
CreatedBy [LAN UserID]
UpdatedAt
UpdatedBy
 
Hi John,

nice, concise answer ;)

Warm Regards,
Crystal
MVP Microsoft Access

remote programming and training
strive4peace2006 at yahoo.com
*
Have an awesome day ;)
 
Hi Pete,

I was looking everywhere go get some information how to create these fields.
I have a form where I need to have who create, update the form or table and
when.

Could you send me an instructions how I can create such a fields I am a
beginner in Access and I am using Access 2003.

CreatedAt [TimeStamp ]
CreatedBy [LAN UserID]
UpdatedAt
UpdatedBy

These are exactly fields I am looking for. Please help. I found your E-mail
when you were helping a guy on Microsoft web page (Subject: Re: Determining
When Table last had data entered 5/10/2006 4:24 PM PST)

Thanks a lot,

Peter Gasparik.
 
Hi Peter,

Make the fields in your table

for CreatedAt, set DefaultValue --> =Now()

CreatedBy will be updated in the form BeforeInsert event

UpdatedAt and UpdatedBy will be updated in the form
BeforeUpdate event

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
Hi,

Thank you for your reply, but as I said I am not very good in Access.
For example how the Access will know who the user is and which name it will
put in the field CreatedBy [LAN UserID] it is same for UpdatedBy???

If you have a time and can you take me trough than would be amazing.

Thank you one more time.

Peter Gasparik
 
Hi Peter,

Where is the LANUserID stored? How do you know who the
current user is?

CreatedBy and UpdatedBy will be the same as far as Access
will use the same value to fill them out in that users
environment -- but UpdatedBy won't get filled out when a
record is added, only when it is modified

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
Hi,

Well to be honest I do not know where the LANUserID stored, but for example
when I click on properties on Microsoft Office Access Record-Locking
Information and then security and then owner it always show who is the
current owner (or who open the database) for example: Peter Gasparik
([email protected]).
I hard that exist a code which will obtain the user ID of the person who is
logged on the current PC. Because I have been given unique ID and I need to
use this ID regarding to log on the PC or Server.

Secondly maybe I can create s special table when I will store all users with
their password in order to log in. Then we probably can use this information
for populating this field, because the user will have to type the user name
and the password.

I have only very small number of users around 20.

Can you advice?

Regards,

Peter Gasparik.
 

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