hello gurus, looking for some help with this in access.
basically, this is trying to copy all files with a certain date string in the filename to 2 separate destinations.
any insight is appreciated!
basically, this is trying to copy all files with a certain date string in the filename to 2 separate destinations.
any insight is appreciated!
Code:
Function RelocateFiles(InputDate As String, strSourcePath As String, strDest1 As String, strDest2 As String)
Dim FSO As Object
Dim FLDR As Object
Dim F As Object
Set FSO = CreateObject("Scripting.FileSystemObject")
Set FLDR = FSO.GetFolder(strSourcePath)
For Each f In FLDR.files
If f Like "*" & InputDate & "*" Then
fso.copyfile strSourcePath, strDest1
fso.copyfile strSourcePath, strDest2
End If
Next f
End Function