move a file from Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a "move" command in Access 2007 that can be called from code that
will move a file from one folder to antother as in command line: move
c:\test\filename c:\new\
 
Hi -

Try copying this to a standard module. Ensure you have a backup before
testing.

Public Sub MoveFile(psourcefile As String, ptargetfile As String)
'*******************************************
'Purpose: Moves file location
'Inputs: sourcefile, targetfile
'To Call: ? MoveFile("c:\mydocuments\all.gif", "c:\mydocuments\access\all.
gif")
'*******************************************
Dim SourceFile, DestinationFile

SourceFile = psourcefile ' Define source file name.
DestinationFile = ptargetfile ' Define target file name.
FileCopy SourceFile, DestinationFile ' Copy source to target.
Kill SourceFile

End Sub


HTH - Bob
 

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

Back
Top