Using FileCopy with a hyperlink.

M

MichelleNH

I have a form which has a field called "Reports". This field contains a
hyperlink to a .zip file on our main server. I'm trying to create a command
button which copies the target and pastes it to another folder
(\\Qc_pdc\pptd\Log\Reports\FY Reports 2006) on the server. I have tried
using FileCopy (and I'm under the impression that my solution involves this
function) but I get so many errors, and I'm not familiar with this programing
language to adaquately debug my code. Here's what I have.

Private Sub Command52_Click()

Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '1
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports 2006" &
[ReferenceNo]& ".zip" '1
FileCopy linksource, linkdestination


End Sub

Feel free to laugh at me, my last programing adventure was my sophomore year
in college (6 years ago) so I have no clue what I'm doing.
 
R

Ron Hinds

MichelleNH said:
I have a form which has a field called "Reports". This field contains a
hyperlink to a .zip file on our main server. I'm trying to create a command
button which copies the target and pastes it to another folder
(\\Qc_pdc\pptd\Log\Reports\FY Reports 2006) on the server. I have tried
using FileCopy (and I'm under the impression that my solution involves this
function) but I get so many errors, and I'm not familiar with this programing
language to adaquately debug my code. Here's what I have.

Private Sub Command52_Click()

Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '1
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports 2006" &
[ReferenceNo]& ".zip" '1
FileCopy linksource, linkdestination


End Sub

Feel free to laugh at me, my last programing adventure was my sophomore year
in college (6 years ago) so I have no clue what I'm doing.

FileCopy is for copying files that exist in the operating system. So the
first parameter you have ("Me.Report") doesn't seem to be the name of an
actual file. It appears that what you are trying to do is export a report to
a file then ZIP it and copy the ZIP file to a server location. If that's the
case then you have some more code to write. Repost with your question
rephrased and I'm sure someone here will be able to help you!
 
M

MichelleNH

I guess I don't understand. I am trying to make a copy of a file on a
server to another folder on it's same server. The report field contains the
full name of the file (a zip file) in the form of a hyperlink. Is it even
possible to copy a .zip file using Access?

Ron Hinds said:
MichelleNH said:
I have a form which has a field called "Reports". This field contains a
hyperlink to a .zip file on our main server. I'm trying to create a command
button which copies the target and pastes it to another folder
(\\Qc_pdc\pptd\Log\Reports\FY Reports 2006) on the server. I have tried
using FileCopy (and I'm under the impression that my solution involves this
function) but I get so many errors, and I'm not familiar with this programing
language to adaquately debug my code. Here's what I have.

Private Sub Command52_Click()

Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '1
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports 2006" &
[ReferenceNo]& ".zip" '1
FileCopy linksource, linkdestination


End Sub

Feel free to laugh at me, my last programing adventure was my sophomore year
in college (6 years ago) so I have no clue what I'm doing.

FileCopy is for copying files that exist in the operating system. So the
first parameter you have ("Me.Report") doesn't seem to be the name of an
actual file. It appears that what you are trying to do is export a report to
a file then ZIP it and copy the ZIP file to a server location. If that's the
case then you have some more code to write. Repost with your question
rephrased and I'm sure someone here will be able to help you!
 
R

Ron Hinds

I see. Well it is definitely possible to do that with FileCopy. I would need
to know the exact error message(s) in order to help you.

MichelleNH said:
I guess I don't understand. I am trying to make a copy of a file on a
server to another folder on it's same server. The report field contains the
full name of the file (a zip file) in the form of a hyperlink. Is it even
possible to copy a .zip file using Access?

Ron Hinds said:
MichelleNH said:
I have a form which has a field called "Reports". This field contains a
hyperlink to a .zip file on our main server. I'm trying to create a command
button which copies the target and pastes it to another folder
(\\Qc_pdc\pptd\Log\Reports\FY Reports 2006) on the server. I have tried
using FileCopy (and I'm under the impression that my solution involves this
function) but I get so many errors, and I'm not familiar with this programing
language to adaquately debug my code. Here's what I have.

Private Sub Command52_Click()

Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '1
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports 2006" &
[ReferenceNo]& ".zip" '1
FileCopy linksource, linkdestination


End Sub

Feel free to laugh at me, my last programing adventure was my
sophomore
year
in college (6 years ago) so I have no clue what I'm doing.

FileCopy is for copying files that exist in the operating system. So the
first parameter you have ("Me.Report") doesn't seem to be the name of an
actual file. It appears that what you are trying to do is export a report to
a file then ZIP it and copy the ZIP file to a server location. If that's the
case then you have some more code to write. Repost with your question
rephrased and I'm sure someone here will be able to help you!
 
M

MichelleNH

I am getting a "File not found" error, which didn't surprise me since I was
guessing at how to reference the source and destination files. It does
compile, so that's a plus!

Ron Hinds said:
I see. Well it is definitely possible to do that with FileCopy. I would need
to know the exact error message(s) in order to help you.

MichelleNH said:
I guess I don't understand. I am trying to make a copy of a file on a
server to another folder on it's same server. The report field contains the
full name of the file (a zip file) in the form of a hyperlink. Is it even
possible to copy a .zip file using Access?

Ron Hinds said:
I have a form which has a field called "Reports". This field
contains a
hyperlink to a .zip file on our main server. I'm trying to create a
command
button which copies the target and pastes it to another folder
(\\Qc_pdc\pptd\Log\Reports\FY Reports 2006) on the server. I have tried
using FileCopy (and I'm under the impression that my solution involves
this
function) but I get so many errors, and I'm not familiar with this
programing
language to adaquately debug my code. Here's what I have.

Private Sub Command52_Click()

Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '1
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports 2006" &
[ReferenceNo]& ".zip" '1
FileCopy linksource, linkdestination


End Sub

Feel free to laugh at me, my last programing adventure was my sophomore
year
in college (6 years ago) so I have no clue what I'm doing.

FileCopy is for copying files that exist in the operating system. So the
first parameter you have ("Me.Report") doesn't seem to be the name of an
actual file. It appears that what you are trying to do is export a report to
a file then ZIP it and copy the ZIP file to a server location. If that's the
case then you have some more code to write. Repost with your question
rephrased and I'm sure someone here will be able to help you!
 
Top