Copy all files and sub-directory under a specific directory

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

Hi,

I would like to create a button in a form to copy all
files with sub-directory from one directory to another
directory. The user will enter the the path of "from"
and "to". Is it possible?I found "FileCopy", "Kill", "RM
dir" but could not find any "Move" function in VB code (I
am using Access 97).

Thank you for your help.
 
i am john from Greece
You can do that but you will need to write many lines of VBA source code.
Use the FolderExists to check if source and destination folder is valid. If not, trap run-time errors by using "On Error Goto..."
Set a variable as object and use the CreateObject reserved method
[ Syntax: Set fs = CreateObject("Scripting.FileSystemObject"]
 
Back
Top