Using the Date Modified of a Table

  • Thread starter Thread starter Steven M. Britton
  • Start date Start date
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
 
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.
 
Back
Top