Formloop with FileCopy?

Descecrator

Registered User.
Local time
Today, 18:22
Joined
Oct 18, 2005
Messages
11
I've got a problem. The database-user can search through the database and the results are displayed in a subform. There's a button attachted to that subform and when that button is pressed, the files, which are linked to the found records and saved outside the database, have to be copied to an other folder. So how do I make I loop for copying those files?

I've got the following code behind the button (but it doesn't work):

Private Sub Command56_Click()
Dim rst As Recordset
Dim strBnaam As String

Set rst = CurrentDb.OpenRecordset("[Forms]![frmZoekVast]![qryZoekVast subform]")
With rst
Do While Not (rst.EOF)
.MoveFirst
strBnaam = rst!Tpon
FileCopy "\\NLFS006\A110154$\Stage Bidteam\Systeem\Teksten\" & strBnaam & ".doc", "C:\TempOfferteTraject\" & strBnaam & ".doc"
.MoveNext
Loop
End With
End Sub

Can somebody help me plz ??? THNX!

Greetz
 

Users who are viewing this thread

Back
Top Bottom