Date and Time Tables are Accessed

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a very large database that has some junk tables in it. However, I
don't recall which ones are junk or are not being used. Is there some way to
display when a table was last accessed. I think that would be a good
starting point to clean up.

Short of being able to do that..and having kept it clean as I went, any
other suggestions?

Thanks!
 
Try adding a Date/Time field to each table and set the defaultvalue to
Date() or Now(). It won't help with the existing problem, but you will be
able to see when new records are added. If you need to see when the records
were last updated, you'll need a form and write some code in the AfterUpdate
event something like (aircode):

Sub Form_AfterUpdate()
Me.txtUpdatedTimeStamp = Now
End Sub
 
actually, you would need that code in the BeforeUpdate event (not
AfterUpdate)

Add these 2 fields to all your tables (except lookups) and make them the
last 2 fields.

DateCreated, date, DefaultValue = Now()
DateUpdated, date – set 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 DateUpdated, 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.DateUpdated = now()

~~~

Like Arvin said, this will not help you with your existing problem, but
it will be a help down the road so this doesn;t happen again

unfortunately, there is not an easy way for you to tell when a record
was LOOKED at


Warm Regards,
Crystal
*
(: have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
While the answers for not what I was hoping for...the attention to my
question was great! Thanks to each of you for your quick and thorough
response!
 
you're welcome ;) happy to help

Warm Regards,
Crystal
*
(: have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
strive4peace said:
actually, you would need that code in the BeforeUpdate event (not
AfterUpdate)

Yep, BeforeUpdate is correct. It should look something like:

Sub Form_BeforeUpdate(Cancel As Integer)
Me.txtLastUpdated = 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