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 a file

Status
Not open for further replies.

Vec

IS-IT--Management
Jan 29, 2002
418
US
Can someone show me the code to copy a file from one directory to another? I have a file data.mdb located in C:\Program Files\QuikTrak\data.mdb and I need to code a command button that when pressed will take this file and copy it over into C:\My Documents. -


WebFusion Design
Looking Toward The Future
 

FileCopy "SourcePath", "DestinationPath"
 
FileCopy will work but u can also try using FileSystemObject library since it has many more useful functions

Dim fsoObj As New FileSystemObject

fsoObj.CopyFile <Source>, <Destination>

before using FileSystemObject set the reference to Microsoft Scripting Runtime
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top