Using the Date Modified of a Table

S

Steven M. Britton

How can I (Either in VBA or Access), have it look at the
Date Modified of a table to process an if then else
statement. I have a CSV that is updated everyday, then
used to append the table in my db. I want to have the
system check the modified date to insure that the table
have been updated the day that we are trying to upload
it.

Ideas?

-Steven M. Britton
 
A

Andrew Smith

The DAO tabledef object has a LastUpdated property. I'm not sure if this is
what you want, though, as it returns the date that the table design was last
changed, not the date that data was last added to the table. If this is what
you want then you could use this function:

Public Function TableDate(strTable As String) As Date

Dim tdf As DAO.TableDef
Dim db As DAO.Database

Set db = CurrentDb
Set tdf = db.TableDefs(strTable)

TableDate = tdf.LastUpdated

End Function

If you need to get the date data was last added then you will need to add a
field to the table for this purpose.
 

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