Hello, all. The code below worked fine until Wednesday. I know that sounds ridiculous as I write it. This code views a folder, and creates a table of file names and file dates that are the contents of the folder. The failure is in the line with the ***************** to the right (which are not there in the real code). It just hangs up, and stops entering dates.
Any thoughts would be appreciated.
Sub GetFiles(strPath As String)
Dim rs As Recordset
Dim strFile As String, strDate As Date
'clear out existing data
CurrentDb.Execute "Delete * From DispToRevTbl", dbFailOnError
'open a recordset
Set rs = CurrentDb.OpenRecordset("DispToRevTbl", dbOpenDynaset)
'get the first filename
strFile = Dir(strPath, vbNormal)
'Loop through the balance of files
Do
'check to see if you have a filename
If strFile = "" Then
GoTo ExitHere
End If
strDate = FileDateTime(strPath & strFile)
rs.AddNew
'to save the full path using strPath & strFile
'save only the filename
rs!FileName = strFile
rs!FileDate = strDate *************************************
rs.Update
'try for next filename
strFile = Dir()
Loop
ExitHere:
Set rs = Nothing
'MsgBox ("Directory list is complete.")
End Sub