And you are using Dir in Access?
"Currently, I use dir to provide a list of files in a directory and then add the files that meet a certain date condition to an access table. "
How are you using Dir to get this information? Dir does not get date information by itself.
I would suggest using FSO to get the file names. It does have a DateCreated value. And it is fast. You can use to build an array perhaps of the files that meet your criteria.
IMPORTANT!!!!
The dates returned by FSo may seem wrong (or at least weird). For example:
Code:
Sub MyDates()
Dim fso As Scripting.FileSystemObject
Dim fld As Scripting.Folder
Dim fil As Scripting.File
Dim strNames As String
Set fso = CreateObject("Scripting.FileSystemObject")
Set fld = fso.GetFolder("c:\zzz\Test\test2")
For Each fil In fld.Files
strNames = strNames & fil.Name & vbTab & _
"Created: " & fil.DateCreated & vbTab & _
"Modified: " & fil.DateLastModified & vbCrLf
Next
MsgBox strNames
End Sub
Returns:
B.doc Created: 2010-01-11 1:22:38 PM Modified: 2007-11-29 9:51:48 AM
C.doc Created: 2010-01-11 1:22:38 PM Modified: 2007-11-29 9:52:00 AM
CollectHyperlinks.doc Created: 2010-01-11 1:22:38 PM Modified: 2007-06-22 9:59:53 AM
CollectHyperlinks_A.doc Created: 2010-01-11 1:22:38 PM Modified: 2007-10-23 8:34:47 AM
D.doc Created: 2010-01-11 1:22:38 PM Modified: 2007-11-29 9:52:14 AM
E.doc Created: 2010-01-11 1:22:38 PM Modified: 2007-11-29 9:52:24 AM
Notice that the ModifiedDate is
BEFORE the DateCreated.
ModifiedDate is part of the file information itself (IN the file); DateCreated comes from the OS file system information.
Thus, if you have restored a file, the file is newly
created - as far as the file system is concerned - but it retains its modified date information from the file itself.
In any case, generally speaking, if your logic requires information about the file, FSO is better.
Gerry