Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Fie Folders

Status
Not open for further replies.

LadyDev

Programmer
Jan 29, 2003
86
0
0
US
Hello Experts I would please like some assistance with the following problem.

I have a lot of databases in a file folder on my hard drive (F:\mdbs)

I would like to create two buttons on a form that:

Button One

1. Copies (move) the files that are in (F:\mdbs)to a new folder F:\Archived\Mdbs\2003.

2. List the files that were moved in the directory and gives a message saying that everything is complete and tells them the name and location of the folder.

Button Two

2. I would like the user to be able to transfer(copy/move/save)to disk the database (or database)of choice.

3. List the files transferred and gives a messages saying that everything is complete and tells them the name of files copied.

For example:

F:\mdbs (List of Files) Move In Dir F:\Archived\Mdbs\2003
--------------------- ---------------------------
Testdb1.mdb Testdb2.mdb
Testdb2.mdb Testdb3.mdb
Testdb4.mdb

When button is clicked on: It list all the databases in F:\mdbs the user can then select which database to move to F:\Archived\Mdbs\2003\ (which is also present)or to enter in a name for the new folder and if the folder doesn't exit create it.or gives them an option to point to an existing folder.

Results: (New Folder or Exisitng folder showing)

Existing Folder F:\Archived\Mdbs\2003-----------------------------------
Testdb2.mdb

Message: Your files have been copied to F:\Archived\Mdbs\2003

I am using MS Access 2000. Below is what I have so far, but it just copies all files to an existing folder.

Private Sub cmdCopyFiles_Click()

Dim strSourcePath, strDestinationPath As String
Dim FS As Object

strSourcePath = " F:\mdbs*.*"
strDestinationPath = " F:\Archived\Mdbs\2003\ "

Set FS = CreateObject("Scripting.FileSystemObject")

FS.CopyFile strSourcePath, strDestinationPath

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top