FileCopy

Apr 28, 2006

Hi,

I have a question.

Function makecopy()
FileCopy Currentdb.Name, "C:ackuptemp.mdb"
End Function

It doesn't work,
the error message give out
Permission Denied

How can I make the copy itself? Thanks.

View Replies


ADVERTISEMENT

Looping Throughform And Do FileCopy?

Nov 16, 2005

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 "\NLFS006A110154$Stage BidteamSysteemTeksten" & strBnaam & ".doc", "C:TempOfferteTraject" & strBnaam & ".doc"
.MoveNext
Loop
End With
End Sub

Can somebody help me plz :( ??? THNX!

Greetz

View 2 Replies View Related

Modules & VBA :: FileCopy Command For Each Record In Recordset

Nov 5, 2013

I have a problem with trying to execute a command for each record in a recordset. What I'm trying to build is a file distribution system. I have a form with the path where the source file is and a subform with a couple of records where the destination path is defined. I use the code you will find below, but it will only copy the file to the destination from the first record.So the code will do the filecopy command for every destination.

Code:
Dim Sourcepath, Destinationpath
Sourcepath = Forms![Item distribution]![Item source path]
Destinationpath = Me.Destination_path
Dim rs As DAO.Recordset
Set rs = Me.Form.Recordset

[code]....

View 12 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved