Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vXP Grabbing and storing the date modified on a file 1

Status
Not open for further replies.

mastro78

Programmer
Apr 10, 2007
70
US
I currently have a database that pulls in Excel data from various Excel spreadsheets based on if various unfilled cells are then filled. What I'm looking to do now is write a code that will remove all the data in an Access table associated to any/all Excel files where the name of the file is the same as the previously pulled one, but the date modifed changed. Any suggestions? Thank you.
 
No extra refferences needed

Code:
Dim fso As Object 'Scripting.FileSystemObject
Dim f As Object 'Scripting.File
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFile(Full_Path_To_File & File_Name)
MsgBox "Date Last Modified is: " & f.DateLastModified
Set f = Nothing
Set fso = Nothing
 
Thanks. What would be a way to store the date modifed in a table in Access (table name Spreadsheets as an example). That table currently stores the file name but no other information. The fields in that table are Spreadsheets for the file name and Date for the Date modified.
 
mastro78

How do you store the file names in the table?

BTW Date is a reserved word for Access. Consinder changing it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top