Copy file code

stpiepgr

Member
Local time
Today, 19:00
Joined
Nov 6, 2002
Messages
25
Hi all,

I have searched the archives for this but can't find exactly what I need.

I have a database on map plots that users access from a network drive. Users have an option of adding a new plot record and I would like to have button that allows the user to copy the file from their local drive to the network location for others to access. I would also like to be able to do the opposite..click a button and copy the network file to their local drive for printing. Is this possible and how would it be done.

I know there is a CopyFile code but haven't the foggiest as to how to implement it. Thanks!
 
Use the Filesystemobject

dim fs as varient

Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile source, destination[, overwrite]

this should do the job

:cool:Shadez:cool:
 
When I set this code for the OnClick event I get a "compile error: syntax error" for the following "fs.CopyFile source, destination[, overwrite]"

I don't know enough about this to figure out what I am doing wrong.:confused:
 
I changed the code to the following:

Private Sub Command58_Click()
Dim fs As Variant

Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile Source, destination, [overwrite]

End Sub

This got rid of the syntax error but now when I run the code I get another Run Time Error 2465 saying that it can't find the field "form" specified in the expresssion.

??????
 

Users who are viewing this thread

Back
Top Bottom