File Copy inside Macro

  • Thread starter Thread starter Caprice
  • Start date Start date
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.
 
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
 
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
 
Back
Top