Hello
i have the following code to get file list from specified directory:
the field "File_Name " is not set to accept duplicate
the above code work fine , but when it find the file name exist on the TB1 it
return an error
i need the code if find any error continue to retrive other files on the folder
not exit loop
and also i don't want to make check if file exist it will lower the speed of code
i have the following code to get file list from specified directory:
Code:
Dim db As DAO.Database
Dim TB1 As DAO.Recordset
Dim p As String, x As Variant
Set db= CurrentDb
Set TB1 = db.OpenRecordset("Table1")
p = "E:/Reports /*.xlsx"
x = GetFileList(p)
Select Case IsArray(x)
Case True
For I = LBound(x) To UBound(x)
With TB1
.AddNew
!File_Name = x(I)
.Update
End With
Next I
Case False
MsgBox "No matching(.xlsx) files"
End Select
the field "File_Name " is not set to accept duplicate
the above code work fine , but when it find the file name exist on the TB1 it
return an error
i need the code if find any error continue to retrive other files on the folder
not exit loop
and also i don't want to make check if file exist it will lower the speed of code