File Copy inside Macro

C

Caprice

I have a database that was originally developed in
Access97. In one of the macros there is a FileCopy
command. The macro works except for this feature. The
file is never copied, even when the source and taget path
are pointed to the local drive. Below you will find the
code for the Macro. This macro worked before we upgraded
from Office 97 to Office XP. Has the syntax chaged?


Public Function CopyCA()
'Writes the Database File CA_Program.mdb to the Target
Work Order Directory'

Dim SourceFile As String
Dim DestinationFile As String
Dim FileCheck
Dim DirPath As String

SourceFile = "G:\wra\CA_Program\CA_Program.mdb" ' Define
source file name.
DestinationFile = "H:\" & Text25 & "\" & Text1
& "\CA_Program.mdb" ' Define target file name.
FileCopy SourceFile, DestinationFile ' Copy source to
target.
 
M

May

i am using win2000 and acc2000, it works fine.
Try to use the shell command to fire up .bat file

May
MCP in Access and SQL Server
 
J

Jim/Chris

I do not do this in a macro but in code. It works great
and even will copy an open file. You need full paths.

fso.copyfile "inputfile", "outputfile"

Jim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top