Copy folder and subfolders

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I’m trying to copy folders and sufolders using the following code and don’t
work. I receive an error, path not found

Public Function CopyFLD()
Dim strSQL As String, SourcePath As String, DestPath As String
Dim fs
Set fs = CreateObject("Scripting.FileSystemObject")
SourcePath = Forms![axCopyAllocation]![SourcePath]
DestPath = Forms![axCopyAllocation]![DestPath]
fs.CopyFolder SourcePath, DestPath, True

End Function

If I use msgbox to checjk the path is right and I a use the following code
'fs.CopyFolder "\\SOYA04NTMULTI1\Pasys$\Allocation\Transfer",
"\\Us21808563\Allocation\Transfer", True
works.

What’s happened?
There is another away to copy folders and subfolders?

Thanks regards
José
 
Access has a number of native commands for working with files. See:
FileCopy, Name, MkDir, RmDir and Kill in Visual Basic Help.

Note: When I say Visual Basic Help, I mean open any code window then open
Help. You get a different (and much more useful) Help system than from the
Access interface.

--
--Roger Carlson
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Back
Top