copy files to folder

DaDutch

Registered User.
Local time
Today, 04:08
Joined
May 19, 2005
Messages
10
Hey there,

I have the following problem: I've made a search application that will find PDF files in specified folders.
It writes the name of the filepath and some other info in a table called tblfiles and shows the data in a form.
On that form i would like to create a button that copies all the found files into another folder.
I found something about FileCopy but i can't seem to get it to work.
If someone couldhelp me out I would greatly appreciate it.
Thanks in advance,

Greetz,
Rutger
 
Search for forum for your question has been asked and answered in previous threads.
 
DaDutch said:
I found something about FileCopy but i can't seem to get it to work

How can we tell you what you're doing wrong when you haven't given anything to work with?
 
sorry

sorry I wasn't clear enough.
i did find out now how to copy one file but now i want it to copy all the found file (all the files which path's are stored in a table).

this is the code i'm using so far.


Code:
Private Sub Command55_Click()
    Dim rs1                 As Recordset
    Dim sPath               As String
    Dim file                As String
    
    Set rs1 = CurrentDb.OpenRecordset("tblFiles", dbOpenDynaset)
    With rs1
        While Not (rs1.EOF)
        .MoveFirst
            sPath = rs1!FilePathName
        
                Do While Right$(sPath, 1) <> "\"
                sPath = Left$(sPath, Len(sPath) - 1)
                Loop
            file = Mid$(FilePathName, Len(sPath) + 1)
    
            FileCopy FilePathName, "c:\digitaledossiers\" & file
        .MoveNext
        Wend
        End With
        
End Sub

if anyone could help me out i would greatly appreciate it.
greetz,
Rutger
 

Users who are viewing this thread

Back
Top Bottom