Upload File

M

MichelleNH

I did search for this question, however I may be unsure how seemingly related
questions relate to my problem so I'll ask specifically.

I have created a database that stores all of the work that comes through our
office organized by reference number. When the work is done, my boss looks
at form that contains general information with a hyperlink to a folder on our
department server which contains electronic copies of all of our test
results. Each user has his/her own folder, and with all the work we do in a
year, they get messy. My boss goes through and looks at the finished forms
and if it is particularly interesting, she will manually save the hyperlink
to another location. This is not done with most of the files, but enough
for her to think it's a hassle. Is there anyway that we can upload the
hyperlinked files to a central location on the same server without clikcing
through seemingly endless folders?
 
M

MichelleNH

I probably should have clarified this, but I have looked at previously
submitted suggestions (including the FileCopy command) and I just don't see
how I can use that with a hyperlink. I'm not a whiz when working at code, so
I could be missing something that is really obvious.
 
M

MacDermott

OK, I guess I don't really get the picture of what you
a. are doing
b. want to be able to do

Can you tell me a little more about these hyperlinks?
Is there a single hyperlink on the form, or does each record have its
own hyperlink.
Where are the files now?
Where do you want the files to go?
How do you conceive of determining which files are moved?
 
M

MichelleNH

I don't think the real details are necessary, but here are the basics. I
have a single form with a single hyperlink with a reference number as its
primary key. This hyperlink is to a compressed (.zip) file stored on our lab
server. At the discretion of our boss certain hyperlinked files need to be
saved in another folder on this server. I would think that a command
button could copy the hyperlinked file from one location and save it to
another. I have looked at the FileCopy function, but I can find no reference
on how refer to a file name when it is stored as a field on a form. Not to
mention I'm still a little unsure how to set up the destination file (though
I may have figured it out). I hope that helps.
 
M

MacDermott

If your only problem is how to refer to a file name when it is displayed in
a control on a form (data is stored in fields in tables, displayed in
controls on forms), that's not too difficult.
Any data-bound control in Access has a .Value property, which returns
the value it represents.
So, if your hyperlink is displayed in a textbox named HLink, you could
do this:
In the OnClick procedure of your button, type something like this:
MsgBox HLink.Value
Now, when you click on the button, you should get a little gray box
giving you the value of that textbox. I think hyperlinks are stored with
the value to display, a # sign, and the target of the hyperlink, but this
will show you exactly what the syntax is.
You should then be able to figure out how to parse this to get the value you
need.

HTH
 
M

MichelleNH

I guess I don't see how creating that message box for a particular file will
help me create code that can apply to a wide range of files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports 2006" &
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm starting to reach the
point of desperation. I can't find anyone who seems to know exactly how to
do it, and I am not well versed in code.
 
M

MacDermott

What is Me.Report?
Is it a textbox, which holds the full path/filename to a file you want to
move?
If not, it doesn't seem surprising that Access can't find the file you say
you want to move.
Is it perhaps in hyperlink form?
In that case, you'll probably need to parse out the information you
need.
I'd suggest putting
msgbox Me.Report
just before your FileCopy statement - that will show you what Access
sees in that control. If it's not obvious to you how to parse out the full
path/filename, post the contents of the messagebox, and we'll try to help...

MichelleNH said:
I guess I don't see how creating that message box for a particular file will
help me create code that can apply to a wide range of files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports 2006" &
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm starting to reach the
point of desperation. I can't find anyone who seems to know exactly how to
do it, and I am not well versed in code.

MacDermott said:
If your only problem is how to refer to a file name when it is displayed in
a control on a form (data is stored in fields in tables, displayed in
controls on forms), that's not too difficult.
Any data-bound control in Access has a .Value property, which returns
the value it represents.
So, if your hyperlink is displayed in a textbox named HLink, you could
do this:
In the OnClick procedure of your button, type something like this:
MsgBox HLink.Value
Now, when you click on the button, you should get a little gray box
giving you the value of that textbox. I think hyperlinks are stored with
the value to display, a # sign, and the target of the hyperlink, but this
will show you exactly what the syntax is.
You should then be able to figure out how to parse this to get the value you
need.

HTH


our
lab need to
be Not
to have
its at
code, my
boss a
folder our
test work
we files,
but
 
M

MichelleNH

Well, Me.Report is a text box bound to a field in a master table which stores
a hyperlink. When I did the msgbox Me.Report I got:

\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#

So I'm not sure what to do next.

MacDermott said:
What is Me.Report?
Is it a textbox, which holds the full path/filename to a file you want to
move?
If not, it doesn't seem surprising that Access can't find the file you say
you want to move.
Is it perhaps in hyperlink form?
In that case, you'll probably need to parse out the information you
need.
I'd suggest putting
msgbox Me.Report
just before your FileCopy statement - that will show you what Access
sees in that control. If it's not obvious to you how to parse out the full
path/filename, post the contents of the messagebox, and we'll try to help...

MichelleNH said:
I guess I don't see how creating that message box for a particular file will
help me create code that can apply to a wide range of files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports 2006" &
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm starting to reach the
point of desperation. I can't find anyone who seems to know exactly how to
do it, and I am not well versed in code.

MacDermott said:
If your only problem is how to refer to a file name when it is displayed in
a control on a form (data is stored in fields in tables, displayed in
controls on forms), that's not too difficult.
Any data-bound control in Access has a .Value property, which returns
the value it represents.
So, if your hyperlink is displayed in a textbox named HLink, you could
do this:
In the OnClick procedure of your button, type something like this:
MsgBox HLink.Value
Now, when you click on the button, you should get a little gray box
giving you the value of that textbox. I think hyperlinks are stored with
the value to display, a # sign, and the target of the hyperlink, but this
will show you exactly what the syntax is.
You should then be able to figure out how to parse this to get the value you
need.

HTH


I don't think the real details are necessary, but here are the basics. I
have a single form with a single hyperlink with a reference number as its
primary key. This hyperlink is to a compressed (.zip) file stored on our
lab
server. At the discretion of our boss certain hyperlinked files need to
be
saved in another folder on this server. I would think that a command
button could copy the hyperlinked file from one location and save it to
another. I have looked at the FileCopy function, but I can find no
reference
on how refer to a file name when it is stored as a field on a form. Not
to
mention I'm still a little unsure how to set up the destination file
(though
I may have figured it out). I hope that helps.



:

OK, I guess I don't really get the picture of what you
a. are doing
b. want to be able to do

Can you tell me a little more about these hyperlinks?
Is there a single hyperlink on the form, or does each record have
its
own hyperlink.
Where are the files now?
Where do you want the files to go?
How do you conceive of determining which files are moved?

I probably should have clarified this, but I have looked at previously
submitted suggestions (including the FileCopy command) and I just
don't
see
how I can use that with a hyperlink. I'm not a whiz when working at
code,
so
I could be missing something that is really obvious.


:

You might look at the FileCopy command.

I did search for this question, however I may be unsure how
seemingly
related
questions relate to my problem so I'll ask specifically.

I have created a database that stores all of the work that comes
through
our
office organized by reference number. When the work is done, my
boss
looks
at form that contains general information with a hyperlink to a
folder
on
our
department server which contains electronic copies of all of our
test
results. Each user has his/her own folder, and with all the work
we
do
in a
year, they get messy. My boss goes through and looks at the
finished
forms
and if it is particularly interesting, she will manually save the
hyperlink
to another location. This is not done with most of the files,
but
enough
for her to think it's a hassle. Is there anyway that we can
upload
the
hyperlinked files to a central location on the same server without
clikcing
through seemingly endless folders?
 
M

MacDermott

Well, I'd guess that the address you want to extract is this:
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP testing\1226\2614-05.zip

You could write a little function like this:
Public function ExtractAddressFromHyperlink(HLink as String) as String
Dim HashPlace as long
HashPlace=Instr(HLink,"#")
ExtractAddressFromHyperlink=left(HLink,HashPlace-1)
End Function

Then you can set your linksource like this:
linksource = ExtractAddressFromHyperlink(Me.Report)

HTH


MichelleNH said:
Well, Me.Report is a text box bound to a field in a master table which stores
a hyperlink. When I did the msgbox Me.Report I got:

\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#

So I'm not sure what to do next.

MacDermott said:
What is Me.Report?
Is it a textbox, which holds the full path/filename to a file you want to
move?
If not, it doesn't seem surprising that Access can't find the file you say
you want to move.
Is it perhaps in hyperlink form?
In that case, you'll probably need to parse out the information you
need.
I'd suggest putting
msgbox Me.Report
just before your FileCopy statement - that will show you what Access
sees in that control. If it's not obvious to you how to parse out the full
path/filename, post the contents of the messagebox, and we'll try to help...

MichelleNH said:
I guess I don't see how creating that message box for a particular
file
will
help me create code that can apply to a wide range of files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports 2006" &
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm starting to reach the
point of desperation. I can't find anyone who seems to know exactly
how
to
do it, and I am not well versed in code.

:

If your only problem is how to refer to a file name when it is
displayed
in
a control on a form (data is stored in fields in tables, displayed in
controls on forms), that's not too difficult.
Any data-bound control in Access has a .Value property, which returns
the value it represents.
So, if your hyperlink is displayed in a textbox named HLink, you could
do this:
In the OnClick procedure of your button, type something like this:
MsgBox HLink.Value
Now, when you click on the button, you should get a little gray box
giving you the value of that textbox. I think hyperlinks are stored with
the value to display, a # sign, and the target of the hyperlink, but this
will show you exactly what the syntax is.
You should then be able to figure out how to parse this to get the
value
you
need.

HTH


I don't think the real details are necessary, but here are the
basics.
I
have a single form with a single hyperlink with a reference number
as
its
primary key. This hyperlink is to a compressed (.zip) file stored
on
our
lab
server. At the discretion of our boss certain hyperlinked files need to
be
saved in another folder on this server. I would think that a command
button could copy the hyperlinked file from one location and save
it
to
another. I have looked at the FileCopy function, but I can find no
reference
on how refer to a file name when it is stored as a field on a
form.
Not
to
mention I'm still a little unsure how to set up the destination file
(though
I may have figured it out). I hope that helps.



:

OK, I guess I don't really get the picture of what you
a. are doing
b. want to be able to do

Can you tell me a little more about these hyperlinks?
Is there a single hyperlink on the form, or does each record have
its
own hyperlink.
Where are the files now?
Where do you want the files to go?
How do you conceive of determining which files are moved?

I probably should have clarified this, but I have looked at previously
submitted suggestions (including the FileCopy command) and I just
don't
see
how I can use that with a hyperlink. I'm not a whiz when
working
at
code,
so
I could be missing something that is really obvious.


:

You might look at the FileCopy command.

I did search for this question, however I may be unsure how
seemingly
related
questions relate to my problem so I'll ask specifically.

I have created a database that stores all of the work that comes
through
our
office organized by reference number. When the work is
done,
my
boss
looks
at form that contains general information with a hyperlink
to
a
folder
on
our
department server which contains electronic copies of all
of
our
test
results. Each user has his/her own folder, and with all
the
work
we
do
in a
year, they get messy. My boss goes through and looks at the
finished
forms
and if it is particularly interesting, she will manually
save
the
hyperlink
to another location. This is not done with most of the files,
but
enough
for her to think it's a hassle. Is there anyway that we can
upload
the
hyperlinked files to a central location on the same server without
clikcing
through seemingly endless folders?
 
M

MichelleNH

Thanks! I put the function you sent me in a module and modified the On_Click
properties, however when I press the button nothing happens. Am I missing
(yet another) step?

MacDermott said:
Well, I'd guess that the address you want to extract is this:
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP testing\1226\2614-05.zip

You could write a little function like this:
Public function ExtractAddressFromHyperlink(HLink as String) as String
Dim HashPlace as long
HashPlace=Instr(HLink,"#")
ExtractAddressFromHyperlink=left(HLink,HashPlace-1)
End Function

Then you can set your linksource like this:
linksource = ExtractAddressFromHyperlink(Me.Report)

HTH


MichelleNH said:
Well, Me.Report is a text box bound to a field in a master table which stores
a hyperlink. When I did the msgbox Me.Report I got:

\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#

So I'm not sure what to do next.

MacDermott said:
What is Me.Report?
Is it a textbox, which holds the full path/filename to a file you want to
move?
If not, it doesn't seem surprising that Access can't find the file you say
you want to move.
Is it perhaps in hyperlink form?
In that case, you'll probably need to parse out the information you
need.
I'd suggest putting
msgbox Me.Report
just before your FileCopy statement - that will show you what Access
sees in that control. If it's not obvious to you how to parse out the full
path/filename, post the contents of the messagebox, and we'll try to help...

I guess I don't see how creating that message box for a particular file
will
help me create code that can apply to a wide range of files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports 2006" &
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm starting to reach the
point of desperation. I can't find anyone who seems to know exactly how
to
do it, and I am not well versed in code.

:

If your only problem is how to refer to a file name when it is displayed
in
a control on a form (data is stored in fields in tables, displayed in
controls on forms), that's not too difficult.
Any data-bound control in Access has a .Value property, which
returns
the value it represents.
So, if your hyperlink is displayed in a textbox named HLink, you
could
do this:
In the OnClick procedure of your button, type something like
this:
MsgBox HLink.Value
Now, when you click on the button, you should get a little gray box
giving you the value of that textbox. I think hyperlinks are stored
with
the value to display, a # sign, and the target of the hyperlink, but
this
will show you exactly what the syntax is.
You should then be able to figure out how to parse this to get the value
you
need.

HTH


I don't think the real details are necessary, but here are the basics.
I
have a single form with a single hyperlink with a reference number as
its
primary key. This hyperlink is to a compressed (.zip) file stored on
our
lab
server. At the discretion of our boss certain hyperlinked files
need to
be
saved in another folder on this server. I would think that a
command
button could copy the hyperlinked file from one location and save it
to
another. I have looked at the FileCopy function, but I can find no
reference
on how refer to a file name when it is stored as a field on a form.
Not
to
mention I'm still a little unsure how to set up the destination file
(though
I may have figured it out). I hope that helps.



:

OK, I guess I don't really get the picture of what you
a. are doing
b. want to be able to do

Can you tell me a little more about these hyperlinks?
Is there a single hyperlink on the form, or does each record
have
its
own hyperlink.
Where are the files now?
Where do you want the files to go?
How do you conceive of determining which files are moved?

I probably should have clarified this, but I have looked at
previously
submitted suggestions (including the FileCopy command) and I just
don't
see
how I can use that with a hyperlink. I'm not a whiz when working
at
code,
so
I could be missing something that is really obvious.


:

You might look at the FileCopy command.

message
I did search for this question, however I may be unsure how
seemingly
related
questions relate to my problem so I'll ask specifically.

I have created a database that stores all of the work that
comes
through
our
office organized by reference number. When the work is done,
my
boss
looks
at form that contains general information with a hyperlink to
a
folder
on
our
department server which contains electronic copies of all of
our
test
results. Each user has his/her own folder, and with all the
work
we
do
in a
year, they get messy. My boss goes through and looks at the
finished
forms
and if it is particularly interesting, she will manually save
the
hyperlink
to another location. This is not done with most of the
files,
but
enough
for her to think it's a hassle. Is there anyway that we can
upload
the
hyperlinked files to a central location on the same server
without
clikcing
through seemingly endless folders?
 
M

MacDermott

Let me just make sure we're talking about the same thing:
When you say you modified the On_Click properties, do you mean that you
changed the code which runs when you click the button?
(We usually call that the button's OnClick Event Procedure.)
Could you post the full code for that procedure, as it stands now?
Also, open the form in Design View, select the button, and verify in its
Properties Page that OnClick is set to [Event Procedure].


MichelleNH said:
Thanks! I put the function you sent me in a module and modified the On_Click
properties, however when I press the button nothing happens. Am I missing
(yet another) step?

MacDermott said:
Well, I'd guess that the address you want to extract is this:
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP testing\1226\2614-05.zip

You could write a little function like this:
Public function ExtractAddressFromHyperlink(HLink as String) as String
Dim HashPlace as long
HashPlace=Instr(HLink,"#")
ExtractAddressFromHyperlink=left(HLink,HashPlace-1)
End Function

Then you can set your linksource like this:
linksource = ExtractAddressFromHyperlink(Me.Report)

HTH


MichelleNH said:
Well, Me.Report is a text box bound to a field in a master table which stores
a hyperlink. When I did the msgbox Me.Report I got:

\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#

So I'm not sure what to do next.

:

What is Me.Report?
Is it a textbox, which holds the full path/filename to a file you
want
to
move?
If not, it doesn't seem surprising that Access can't find the file
you
say
you want to move.
Is it perhaps in hyperlink form?
In that case, you'll probably need to parse out the information you
need.
I'd suggest putting
msgbox Me.Report
just before your FileCopy statement - that will show you what Access
sees in that control. If it's not obvious to you how to parse out
the
full
path/filename, post the contents of the messagebox, and we'll try to help...

I guess I don't see how creating that message box for a particular file
will
help me create code that can apply to a wide range of files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports
2006"
&
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm starting to
reach
the
point of desperation. I can't find anyone who seems to know
exactly
how
to
do it, and I am not well versed in code.

:

If your only problem is how to refer to a file name when it is displayed
in
a control on a form (data is stored in fields in tables,
displayed
in
controls on forms), that's not too difficult.
Any data-bound control in Access has a .Value property, which
returns
the value it represents.
So, if your hyperlink is displayed in a textbox named HLink, you
could
do this:
In the OnClick procedure of your button, type something like
this:
MsgBox HLink.Value
Now, when you click on the button, you should get a little
gray
box
giving you the value of that textbox. I think hyperlinks are stored
with
the value to display, a # sign, and the target of the hyperlink, but
this
will show you exactly what the syntax is.
You should then be able to figure out how to parse this to get
the
value
you
need.

HTH


I don't think the real details are necessary, but here are the basics.
I
have a single form with a single hyperlink with a reference
number
as
its
primary key. This hyperlink is to a compressed (.zip) file
stored
on
our
lab
server. At the discretion of our boss certain hyperlinked files
need to
be
saved in another folder on this server. I would think that a
command
button could copy the hyperlinked file from one location and
save
it
to
another. I have looked at the FileCopy function, but I can
find
no
reference
on how refer to a file name when it is stored as a field on a form.
Not
to
mention I'm still a little unsure how to set up the
destination
file
(though
I may have figured it out). I hope that helps.



:

OK, I guess I don't really get the picture of what you
a. are doing
b. want to be able to do

Can you tell me a little more about these hyperlinks?
Is there a single hyperlink on the form, or does each record
have
its
own hyperlink.
Where are the files now?
Where do you want the files to go?
How do you conceive of determining which files are moved?

I probably should have clarified this, but I have looked at
previously
submitted suggestions (including the FileCopy command) and
I
just
don't
see
how I can use that with a hyperlink. I'm not a whiz when working
at
code,
so
I could be missing something that is really obvious.


:

You might look at the FileCopy command.

message
I did search for this question, however I may be
unsure
how
seemingly
related
questions relate to my problem so I'll ask specifically.

I have created a database that stores all of the work that
comes
through
our
office organized by reference number. When the work
is
done,
my
boss
looks
at form that contains general information with a
hyperlink
to
a
folder
on
our
department server which contains electronic copies of
all
of
our
test
results. Each user has his/her own folder, and with
all
the
work
we
do
in a
year, they get messy. My boss goes through and looks
at
the
finished
forms
and if it is particularly interesting, she will
manually
save
the
hyperlink
to another location. This is not done with most of the
files,
but
enough
for her to think it's a hassle. Is there anyway that
we
can
upload
the
hyperlinked files to a central location on the same server
without
clikcing
through seemingly endless folders?
 
M

MichelleNH

Okay, currently my error message is "Invaild use of null", I'm not sure what
I did to change that. My On Click Event Procedure is:

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

End Sub

The On Click field is indeed set to [Event Procedure]
Thanks again for your help!


MacDermott said:
Let me just make sure we're talking about the same thing:
When you say you modified the On_Click properties, do you mean that you
changed the code which runs when you click the button?
(We usually call that the button's OnClick Event Procedure.)
Could you post the full code for that procedure, as it stands now?
Also, open the form in Design View, select the button, and verify in its
Properties Page that OnClick is set to [Event Procedure].


MichelleNH said:
Thanks! I put the function you sent me in a module and modified the On_Click
properties, however when I press the button nothing happens. Am I missing
(yet another) step?

MacDermott said:
Well, I'd guess that the address you want to extract is this:
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP testing\1226\2614-05.zip

You could write a little function like this:
Public function ExtractAddressFromHyperlink(HLink as String) as String
Dim HashPlace as long
HashPlace=Instr(HLink,"#")
ExtractAddressFromHyperlink=left(HLink,HashPlace-1)
End Function

Then you can set your linksource like this:
linksource = ExtractAddressFromHyperlink(Me.Report)

HTH


Well, Me.Report is a text box bound to a field in a master table which
stores
a hyperlink. When I did the msgbox Me.Report I got:

\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#

So I'm not sure what to do next.

:

What is Me.Report?
Is it a textbox, which holds the full path/filename to a file you want
to
move?
If not, it doesn't seem surprising that Access can't find the file you
say
you want to move.
Is it perhaps in hyperlink form?
In that case, you'll probably need to parse out the information you
need.
I'd suggest putting
msgbox Me.Report
just before your FileCopy statement - that will show you what Access
sees in that control. If it's not obvious to you how to parse out the
full
path/filename, post the contents of the messagebox, and we'll try to
help...

I guess I don't see how creating that message box for a particular
file
will
help me create code that can apply to a wide range of files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports 2006"
&
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm starting to reach
the
point of desperation. I can't find anyone who seems to know exactly
how
to
do it, and I am not well versed in code.

:

If your only problem is how to refer to a file name when it is
displayed
in
a control on a form (data is stored in fields in tables, displayed
in
controls on forms), that's not too difficult.
Any data-bound control in Access has a .Value property, which
returns
the value it represents.
So, if your hyperlink is displayed in a textbox named HLink, you
could
do this:
In the OnClick procedure of your button, type something like
this:
MsgBox HLink.Value
Now, when you click on the button, you should get a little gray
box
giving you the value of that textbox. I think hyperlinks are stored
with
the value to display, a # sign, and the target of the hyperlink, but
this
will show you exactly what the syntax is.
You should then be able to figure out how to parse this to get the
value
you
need.

HTH


I don't think the real details are necessary, but here are the
basics.
I
have a single form with a single hyperlink with a reference number
as
its
primary key. This hyperlink is to a compressed (.zip) file stored
on
our
lab
server. At the discretion of our boss certain hyperlinked files
need to
be
saved in another folder on this server. I would think that a
command
button could copy the hyperlinked file from one location and save
it
to
another. I have looked at the FileCopy function, but I can find
no
reference
on how refer to a file name when it is stored as a field on a
form.
Not
to
mention I'm still a little unsure how to set up the destination
file
(though
I may have figured it out). I hope that helps.



:

OK, I guess I don't really get the picture of what you
a. are doing
b. want to be able to do

Can you tell me a little more about these hyperlinks?
Is there a single hyperlink on the form, or does each record
have
its
own hyperlink.
Where are the files now?
Where do you want the files to go?
How do you conceive of determining which files are moved?

message
I probably should have clarified this, but I have looked at
previously
submitted suggestions (including the FileCopy command) and I
just
don't
see
how I can use that with a hyperlink. I'm not a whiz when
working
at
code,
so
I could be missing something that is really obvious.


:

You might look at the FileCopy command.

message
I did search for this question, however I may be unsure
how
seemingly
related
questions relate to my problem so I'll ask specifically.

I have created a database that stores all of the work that
comes
through
our
office organized by reference number. When the work is
done,
my
boss
looks
at form that contains general information with a hyperlink
to
a
folder
on
our
department server which contains electronic copies of all
of
our
test
results. Each user has his/her own folder, and with all
the
work
we
do
in a
year, they get messy. My boss goes through and looks at
the
finished
forms
and if it is particularly interesting, she will manually
save
the
hyperlink
to another location. This is not done with most of the
files,
but
enough
for her to think it's a hassle. Is there anyway that we
can
upload
the
hyperlinked files to a central location on the same server
without
clikcing
through seemingly endless folders?
 
M

MacDermott

Do you know what line of code is causing this error?

MichelleNH said:
Okay, currently my error message is "Invaild use of null", I'm not sure what
I did to change that. My On Click Event Procedure is:

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

End Sub

The On Click field is indeed set to [Event Procedure]
Thanks again for your help!


MacDermott said:
Let me just make sure we're talking about the same thing:
When you say you modified the On_Click properties, do you mean that you
changed the code which runs when you click the button?
(We usually call that the button's OnClick Event Procedure.)
Could you post the full code for that procedure, as it stands now?
Also, open the form in Design View, select the button, and verify in its
Properties Page that OnClick is set to [Event Procedure].


MichelleNH said:
Thanks! I put the function you sent me in a module and modified the On_Click
properties, however when I press the button nothing happens. Am I missing
(yet another) step?

:

Well, I'd guess that the address you want to extract is this:
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP testing\1226\2614-05.zip

You could write a little function like this:
Public function ExtractAddressFromHyperlink(HLink as String) as String
Dim HashPlace as long
HashPlace=Instr(HLink,"#")
ExtractAddressFromHyperlink=left(HLink,HashPlace-1)
End Function

Then you can set your linksource like this:
linksource = ExtractAddressFromHyperlink(Me.Report)

HTH


Well, Me.Report is a text box bound to a field in a master table which
stores
a hyperlink. When I did the msgbox Me.Report I got:

\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#

So I'm not sure what to do next.

:

What is Me.Report?
Is it a textbox, which holds the full path/filename to a file
you
want
to
move?
If not, it doesn't seem surprising that Access can't find the
file
you
say
you want to move.
Is it perhaps in hyperlink form?
In that case, you'll probably need to parse out the
information
you
need.
I'd suggest putting
msgbox Me.Report
just before your FileCopy statement - that will show you
what
Access
sees in that control. If it's not obvious to you how to parse
out
the
full
path/filename, post the contents of the messagebox, and we'll try to
help...

I guess I don't see how creating that message box for a particular
file
will
help me create code that can apply to a wide range of files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY
Reports
2006"
&
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm starting to reach
the
point of desperation. I can't find anyone who seems to know exactly
how
to
do it, and I am not well versed in code.

:

If your only problem is how to refer to a file name when it is
displayed
in
a control on a form (data is stored in fields in tables, displayed
in
controls on forms), that's not too difficult.
Any data-bound control in Access has a .Value property, which
returns
the value it represents.
So, if your hyperlink is displayed in a textbox named
HLink,
you
could
do this:
In the OnClick procedure of your button, type
something
like
this:
MsgBox HLink.Value
Now, when you click on the button, you should get a
little
gray
box
giving you the value of that textbox. I think hyperlinks
are
stored
with
the value to display, a # sign, and the target of the
hyperlink,
but
this
will show you exactly what the syntax is.
You should then be able to figure out how to parse this to
get
the
value
you
need.

HTH


I don't think the real details are necessary, but here are the
basics.
I
have a single form with a single hyperlink with a
reference
number
as
its
primary key. This hyperlink is to a compressed (.zip)
file
stored
on
our
lab
server. At the discretion of our boss certain
hyperlinked
files
need to
be
saved in another folder on this server. I would think
that
a
command
button could copy the hyperlinked file from one location
and
save
it
to
another. I have looked at the FileCopy function, but I
can
find
no
reference
on how refer to a file name when it is stored as a field on a
form.
Not
to
mention I'm still a little unsure how to set up the destination
file
(though
I may have figured it out). I hope that helps.



:

OK, I guess I don't really get the picture of what you
a. are doing
b. want to be able to do

Can you tell me a little more about these hyperlinks?
Is there a single hyperlink on the form, or does
each
record
have
its
own hyperlink.
Where are the files now?
Where do you want the files to go?
How do you conceive of determining which files are moved?

message
I probably should have clarified this, but I have
looked
at
previously
submitted suggestions (including the FileCopy command)
and
I
just
don't
see
how I can use that with a hyperlink. I'm not a whiz when
working
at
code,
so
I could be missing something that is really obvious.


:

You might look at the FileCopy command.

message
I did search for this question, however I may be unsure
how
seemingly
related
questions relate to my problem so I'll ask specifically.

I have created a database that stores all of the
work
that
comes
through
our
office organized by reference number. When the
work
is
done,
my
boss
looks
at form that contains general information with a hyperlink
to
a
folder
on
our
department server which contains electronic copies
of
all
of
our
test
results. Each user has his/her own folder, and
with
all
the
work
we
do
in a
year, they get messy. My boss goes through and
looks
at
the
finished
forms
and if it is particularly interesting, she will manually
save
the
hyperlink
to another location. This is not done with most
of
the
files,
but
enough
for her to think it's a hassle. Is there anyway
that
we
can
upload
the
hyperlinked files to a central location on the
same
server
without
clikcing
through seemingly endless folders?
 
M

MichelleNH

It says the error is in the line:
linksource = ExtractAddressFromHyperlink(Me.Report)

MacDermott said:
Do you know what line of code is causing this error?

MichelleNH said:
Okay, currently my error message is "Invaild use of null", I'm not sure what
I did to change that. My On Click Event Procedure is:

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

End Sub

The On Click field is indeed set to [Event Procedure]
Thanks again for your help!


MacDermott said:
Let me just make sure we're talking about the same thing:
When you say you modified the On_Click properties, do you mean that you
changed the code which runs when you click the button?
(We usually call that the button's OnClick Event Procedure.)
Could you post the full code for that procedure, as it stands now?
Also, open the form in Design View, select the button, and verify in its
Properties Page that OnClick is set to [Event Procedure].


Thanks! I put the function you sent me in a module and modified the
On_Click
properties, however when I press the button nothing happens. Am I
missing
(yet another) step?

:

Well, I'd guess that the address you want to extract is this:
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP testing\1226\2614-05.zip

You could write a little function like this:
Public function ExtractAddressFromHyperlink(HLink as String) as String
Dim HashPlace as long
HashPlace=Instr(HLink,"#")
ExtractAddressFromHyperlink=left(HLink,HashPlace-1)
End Function

Then you can set your linksource like this:
linksource = ExtractAddressFromHyperlink(Me.Report)

HTH


Well, Me.Report is a text box bound to a field in a master table which
stores
a hyperlink. When I did the msgbox Me.Report I got:

\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#

So I'm not sure what to do next.

:

What is Me.Report?
Is it a textbox, which holds the full path/filename to a file you
want
to
move?
If not, it doesn't seem surprising that Access can't find the file
you
say
you want to move.
Is it perhaps in hyperlink form?
In that case, you'll probably need to parse out the information
you
need.
I'd suggest putting
msgbox Me.Report
just before your FileCopy statement - that will show you what
Access
sees in that control. If it's not obvious to you how to parse out
the
full
path/filename, post the contents of the messagebox, and we'll try to
help...

I guess I don't see how creating that message box for a particular
file
will
help me create code that can apply to a wide range of files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports
2006"
&
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm starting to
reach
the
point of desperation. I can't find anyone who seems to know
exactly
how
to
do it, and I am not well versed in code.

:

If your only problem is how to refer to a file name when it is
displayed
in
a control on a form (data is stored in fields in tables,
displayed
in
controls on forms), that's not too difficult.
Any data-bound control in Access has a .Value property,
which
returns
the value it represents.
So, if your hyperlink is displayed in a textbox named HLink,
you
could
do this:
In the OnClick procedure of your button, type something
like
this:
MsgBox HLink.Value
Now, when you click on the button, you should get a little
gray
box
giving you the value of that textbox. I think hyperlinks are
stored
with
the value to display, a # sign, and the target of the hyperlink,
but
this
will show you exactly what the syntax is.
You should then be able to figure out how to parse this to get
the
value
you
need.

HTH


message
I don't think the real details are necessary, but here are the
basics.
I
have a single form with a single hyperlink with a reference
number
as
its
primary key. This hyperlink is to a compressed (.zip) file
stored
on
our
lab
server. At the discretion of our boss certain hyperlinked
files
need to
be
saved in another folder on this server. I would think that
a
command
button could copy the hyperlinked file from one location and
save
it
to
another. I have looked at the FileCopy function, but I can
find
no
reference
on how refer to a file name when it is stored as a field on a
form.
Not
to
mention I'm still a little unsure how to set up the
destination
file
(though
I may have figured it out). I hope that helps.



:

OK, I guess I don't really get the picture of what you
a. are doing
b. want to be able to do

Can you tell me a little more about these hyperlinks?
Is there a single hyperlink on the form, or does each
record
have
its
own hyperlink.
Where are the files now?
Where do you want the files to go?
How do you conceive of determining which files are
moved?

message
I probably should have clarified this, but I have looked
at
previously
submitted suggestions (including the FileCopy command) and
I
just
don't
see
how I can use that with a hyperlink. I'm not a whiz when
working
at
code,
so
I could be missing something that is really obvious.


:

You might look at the FileCopy command.

"MichelleNH" <[email protected]>
wrote in
message

I did search for this question, however I may be
unsure
how
seemingly
related
questions relate to my problem so I'll ask
specifically.

I have created a database that stores all of the work
that
comes
through
our
office organized by reference number. When the work
is
done,
my
 
M

MacDermott

What is the value of Me.Report when the error is generated?

MichelleNH said:
It says the error is in the line:
linksource = ExtractAddressFromHyperlink(Me.Report)

MacDermott said:
Do you know what line of code is causing this error?

MichelleNH said:
Okay, currently my error message is "Invaild use of null", I'm not
sure
what
I did to change that. My On Click Event Procedure is:

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

End Sub

The On Click field is indeed set to [Event Procedure]
Thanks again for your help!


:

Let me just make sure we're talking about the same thing:
When you say you modified the On_Click properties, do you mean that you
changed the code which runs when you click the button?
(We usually call that the button's OnClick Event Procedure.)
Could you post the full code for that procedure, as it stands now?
Also, open the form in Design View, select the button, and verify in its
Properties Page that OnClick is set to [Event Procedure].


Thanks! I put the function you sent me in a module and modified the
On_Click
properties, however when I press the button nothing happens. Am I
missing
(yet another) step?

:

Well, I'd guess that the address you want to extract is this:
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP testing\1226\2614-05.zip

You could write a little function like this:
Public function ExtractAddressFromHyperlink(HLink as String) as String
Dim HashPlace as long
HashPlace=Instr(HLink,"#")
ExtractAddressFromHyperlink=left(HLink,HashPlace-1)
End Function

Then you can set your linksource like this:
linksource = ExtractAddressFromHyperlink(Me.Report)

HTH


Well, Me.Report is a text box bound to a field in a master
table
which
stores
a hyperlink. When I did the msgbox Me.Report I got:

\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#

So I'm not sure what to do next.

:

What is Me.Report?
Is it a textbox, which holds the full path/filename to a
file
you
want
to
move?
If not, it doesn't seem surprising that Access can't find
the
file
you
say
you want to move.
Is it perhaps in hyperlink form?
In that case, you'll probably need to parse out the information
you
need.
I'd suggest putting
msgbox Me.Report
just before your FileCopy statement - that will show you what
Access
sees in that control. If it's not obvious to you how to
parse
out
the
full
path/filename, post the contents of the messagebox, and
we'll
try to
help...

I guess I don't see how creating that message box for a particular
file
will
help me create code that can apply to a wide range of files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY Reports
2006"
&
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm starting to
reach
the
point of desperation. I can't find anyone who seems to know
exactly
how
to
do it, and I am not well versed in code.

:

If your only problem is how to refer to a file name when
it
is
displayed
in
a control on a form (data is stored in fields in tables,
displayed
in
controls on forms), that's not too difficult.
Any data-bound control in Access has a .Value property,
which
returns
the value it represents.
So, if your hyperlink is displayed in a textbox
named
HLink,
you
could
do this:
In the OnClick procedure of your button, type something
like
this:
MsgBox HLink.Value
Now, when you click on the button, you should get a little
gray
box
giving you the value of that textbox. I think
hyperlinks
are
stored
with
the value to display, a # sign, and the target of the hyperlink,
but
this
will show you exactly what the syntax is.
You should then be able to figure out how to parse this
to
get
the
value
you
need.

HTH


message
I don't think the real details are necessary, but here
are
the
basics.
I
have a single form with a single hyperlink with a reference
number
as
its
primary key. This hyperlink is to a compressed (.zip) file
stored
on
our
lab
server. At the discretion of our boss certain hyperlinked
files
need to
be
saved in another folder on this server. I would
think
that
a
command
button could copy the hyperlinked file from one
location
and
save
it
to
another. I have looked at the FileCopy function, but
I
can
find
no
reference
on how refer to a file name when it is stored as a
field
on a
form.
Not
to
mention I'm still a little unsure how to set up the
destination
file
(though
I may have figured it out). I hope that helps.



:

OK, I guess I don't really get the picture of what you
a. are doing
b. want to be able to do

Can you tell me a little more about these hyperlinks?
Is there a single hyperlink on the form, or does each
record
have
its
own hyperlink.
Where are the files now?
Where do you want the files to go?
How do you conceive of determining which files are
moved?

message
I probably should have clarified this, but I have looked
at
previously
submitted suggestions (including the FileCopy
command)
and
I
just
don't
see
how I can use that with a hyperlink. I'm not a
whiz
when
working
at
code,
so
I could be missing something that is really obvious.


:

You might look at the FileCopy command.

"MichelleNH"
wrote in
message

I did search for this question, however I may be
unsure
how
seemingly
related
questions relate to my problem so I'll ask
specifically.

I have created a database that stores all of
the
work
that
comes
through
our
office organized by reference number. When
the
work
is
done,
my
 
M

MichelleNH

Okay, today I'm getting a file/path access error at the
FileCopy linksource, linkdestination line. I didn't knowingly change any
of the code (and I've just double checked it). I been having weird issues
with hyperlink shortcut menus disappearing, so nothing surprises me at this
point.
The value of me.Report is
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP testing\1226\2614-05.zip
MacDermott said:
What is the value of Me.Report when the error is generated?

MichelleNH said:
It says the error is in the line:
linksource = ExtractAddressFromHyperlink(Me.Report)

MacDermott said:
Do you know what line of code is causing this error?

Okay, currently my error message is "Invaild use of null", I'm not sure
what
I did to change that. My On Click Event Procedure is:

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

End Sub

The On Click field is indeed set to [Event Procedure]
Thanks again for your help!


:

Let me just make sure we're talking about the same thing:
When you say you modified the On_Click properties, do you mean that you
changed the code which runs when you click the button?
(We usually call that the button's OnClick Event Procedure.)
Could you post the full code for that procedure, as it stands now?
Also, open the form in Design View, select the button, and verify in its
Properties Page that OnClick is set to [Event Procedure].


Thanks! I put the function you sent me in a module and modified the
On_Click
properties, however when I press the button nothing happens. Am I
missing
(yet another) step?

:

Well, I'd guess that the address you want to extract is this:
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP testing\1226\2614-05.zip

You could write a little function like this:
Public function ExtractAddressFromHyperlink(HLink as String) as
String
Dim HashPlace as long
HashPlace=Instr(HLink,"#")
ExtractAddressFromHyperlink=left(HLink,HashPlace-1)
End Function

Then you can set your linksource like this:
linksource = ExtractAddressFromHyperlink(Me.Report)

HTH


Well, Me.Report is a text box bound to a field in a master table
which
stores
a hyperlink. When I did the msgbox Me.Report I got:

\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#

So I'm not sure what to do next.

:

What is Me.Report?
Is it a textbox, which holds the full path/filename to a file
you
want
to
move?
If not, it doesn't seem surprising that Access can't find the
file
you
say
you want to move.
Is it perhaps in hyperlink form?
In that case, you'll probably need to parse out the
information
you
need.
I'd suggest putting
msgbox Me.Report
just before your FileCopy statement - that will show you
what
Access
sees in that control. If it's not obvious to you how to parse
out
the
full
path/filename, post the contents of the messagebox, and we'll
try to
help...

message
I guess I don't see how creating that message box for a
particular
file
will
help me create code that can apply to a wide range of files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY
Reports
2006"
&
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm starting to
reach
the
point of desperation. I can't find anyone who seems to know
exactly
how
to
do it, and I am not well versed in code.

:

If your only problem is how to refer to a file name when it
is
displayed
in
a control on a form (data is stored in fields in tables,
displayed
in
controls on forms), that's not too difficult.
Any data-bound control in Access has a .Value property,
which
returns
the value it represents.
So, if your hyperlink is displayed in a textbox named
HLink,
you
could
do this:
In the OnClick procedure of your button, type
something
like
this:
MsgBox HLink.Value
Now, when you click on the button, you should get a
little
gray
box
giving you the value of that textbox. I think hyperlinks
are
stored
with
the value to display, a # sign, and the target of the
hyperlink,
but
this
will show you exactly what the syntax is.
You should then be able to figure out how to parse this to
get
the
value
you
need.

HTH


message
I don't think the real details are necessary, but here are
the
basics.
I
have a single form with a single hyperlink with a
reference
number
as
its
primary key. This hyperlink is to a compressed (.zip)
file
stored
on
our
lab
server. At the discretion of our boss certain
hyperlinked
files
need to
be
saved in another folder on this server. I would think
that
a
command
button could copy the hyperlinked file from one location
and
save
it
to
another. I have looked at the FileCopy function, but I
can
find
no
reference
on how refer to a file name when it is stored as a field
on a
form.
Not
to
mention I'm still a little unsure how to set up the
destination
file
(though
I may have figured it out). I hope that helps.



:

OK, I guess I don't really get the picture of what you
a. are doing
b. want to be able to do

Can you tell me a little more about these hyperlinks?
Is there a single hyperlink on the form, or does
each
record
have
its
own hyperlink.
Where are the files now?
Where do you want the files to go?
How do you conceive of determining which files are
moved?

"MichelleNH" <[email protected]>
wrote in
message

I probably should have clarified this, but I have
looked
at
previously
submitted suggestions (including the FileCopy
command)
 
M

MacDermott

I'm afraid I don't know much about hyperlink shortcut menus, but it sort of
looks to me as if you may have some data stored as hyperlinks, and some just
as text strings.

You might want to change the function a little to account for this:If HashPlace=0 then
ExtractAddressFromHyperlink=Hlink
Else
HTH


MichelleNH said:
Okay, today I'm getting a file/path access error at the
FileCopy linksource, linkdestination line. I didn't knowingly change any
of the code (and I've just double checked it). I been having weird issues
with hyperlink shortcut menus disappearing, so nothing surprises me at this
point.
The value of me.Report is
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP testing\1226\2614-05.zip
MacDermott said:
What is the value of Me.Report when the error is generated?

MichelleNH said:
It says the error is in the line:
linksource = ExtractAddressFromHyperlink(Me.Report)

:

Do you know what line of code is causing this error?

Okay, currently my error message is "Invaild use of null", I'm not sure
what
I did to change that. My On Click Event Procedure is:

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

End Sub

The On Click field is indeed set to [Event Procedure]
Thanks again for your help!


:

Let me just make sure we're talking about the same thing:
When you say you modified the On_Click properties, do you mean
that
you
changed the code which runs when you click the button?
(We usually call that the button's OnClick Event Procedure.)
Could you post the full code for that procedure, as it stands now?
Also, open the form in Design View, select the button, and
verify in
its
Properties Page that OnClick is set to [Event Procedure].


Thanks! I put the function you sent me in a module and
modified
the
On_Click
properties, however when I press the button nothing happens.
Am
I
missing
(yet another) step?

:

Well, I'd guess that the address you want to extract is this:
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP testing\1226\2614-05.zip

You could write a little function like this:
Public function ExtractAddressFromHyperlink(HLink as String) as
String
Dim HashPlace as long
HashPlace=Instr(HLink,"#")
ExtractAddressFromHyperlink=left(HLink,HashPlace-1)
End Function

Then you can set your linksource like this:
linksource = ExtractAddressFromHyperlink(Me.Report)

HTH


Well, Me.Report is a text box bound to a field in a master table
which
stores
a hyperlink. When I did the msgbox Me.Report I got:

\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#

So I'm not sure what to do next.

:

What is Me.Report?
Is it a textbox, which holds the full path/filename to a file
you
want
to
move?
If not, it doesn't seem surprising that Access can't
find
the
file
you
say
you want to move.
Is it perhaps in hyperlink form?
In that case, you'll probably need to parse out the
information
you
need.
I'd suggest putting
msgbox Me.Report
just before your FileCopy statement - that will show you
what
Access
sees in that control. If it's not obvious to you how to parse
out
the
full
path/filename, post the contents of the messagebox, and we'll
try to
help...

message
I guess I don't see how creating that message box for a
particular
file
will
help me create code that can apply to a wide range of files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY
Reports
2006"
&
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm starting to
reach
the
point of desperation. I can't find anyone who seems
to
know
exactly
how
to
do it, and I am not well versed in code.

:

If your only problem is how to refer to a file name
when
it
is
displayed
in
a control on a form (data is stored in fields in tables,
displayed
in
controls on forms), that's not too difficult.
Any data-bound control in Access has a .Value property,
which
returns
the value it represents.
So, if your hyperlink is displayed in a textbox named
HLink,
you
could
do this:
In the OnClick procedure of your button, type
something
like
this:
MsgBox HLink.Value
Now, when you click on the button, you should get a
little
gray
box
giving you the value of that textbox. I think hyperlinks
are
stored
with
the value to display, a # sign, and the target of the
hyperlink,
but
this
will show you exactly what the syntax is.
You should then be able to figure out how to parse
this
to
get
the
value
you
need.

HTH


message
I don't think the real details are necessary, but
here
are
the
basics.
I
have a single form with a single hyperlink with a
reference
number
as
its
primary key. This hyperlink is to a compressed (.zip)
file
stored
on
our
lab
server. At the discretion of our boss certain
hyperlinked
files
need to
be
saved in another folder on this server. I would think
that
a
command
button could copy the hyperlinked file from one location
and
save
it
to
another. I have looked at the FileCopy function,
but
I
can
find
no
reference
on how refer to a file name when it is stored as a field
on a
form.
Not
to
mention I'm still a little unsure how to set up the
destination
file
(though
I may have figured it out). I hope that helps.



:

OK, I guess I don't really get the picture of
what
you
a. are doing
b. want to be able to do

Can you tell me a little more about these hyperlinks?
Is there a single hyperlink on the form, or does
each
record
have
its
own hyperlink.
Where are the files now?
Where do you want the files to go?
How do you conceive of determining which
files
are
moved?

"MichelleNH"
wrote in
message

I probably should have clarified this, but I have
looked
at
previously
submitted suggestions (including the FileCopy
command)
 
M

MichelleNH

I modified it, but I got the same error anyways. Do you think this could
have something to do with the fact I'm copying a .zip file?

MacDermott said:
I'm afraid I don't know much about hyperlink shortcut menus, but it sort of
looks to me as if you may have some data stored as hyperlinks, and some just
as text strings.

You might want to change the function a little to account for this:If HashPlace=0 then
ExtractAddressFromHyperlink=Hlink
Else
HTH


MichelleNH said:
Okay, today I'm getting a file/path access error at the
FileCopy linksource, linkdestination line. I didn't knowingly change any
of the code (and I've just double checked it). I been having weird issues
with hyperlink shortcut menus disappearing, so nothing surprises me at this
point.
The value of me.Report is
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP testing\1226\2614-05.zip
MacDermott said:
What is the value of Me.Report when the error is generated?

It says the error is in the line:
linksource = ExtractAddressFromHyperlink(Me.Report)

:

Do you know what line of code is causing this error?

Okay, currently my error message is "Invaild use of null", I'm not
sure
what
I did to change that. My On Click Event Procedure is:

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

End Sub

The On Click field is indeed set to [Event Procedure]
Thanks again for your help!


:

Let me just make sure we're talking about the same thing:
When you say you modified the On_Click properties, do you mean that
you
changed the code which runs when you click the button?
(We usually call that the button's OnClick Event Procedure.)
Could you post the full code for that procedure, as it stands now?
Also, open the form in Design View, select the button, and verify in
its
Properties Page that OnClick is set to [Event Procedure].


Thanks! I put the function you sent me in a module and modified
the
On_Click
properties, however when I press the button nothing happens. Am
I
missing
(yet another) step?

:

Well, I'd guess that the address you want to extract is this:
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip

You could write a little function like this:
Public function ExtractAddressFromHyperlink(HLink as String) as
String
Dim HashPlace as long
HashPlace=Instr(HLink,"#")
ExtractAddressFromHyperlink=left(HLink,HashPlace-1)
End Function

Then you can set your linksource like this:
linksource = ExtractAddressFromHyperlink(Me.Report)

HTH


message
Well, Me.Report is a text box bound to a field in a master
table
which
stores
a hyperlink. When I did the msgbox Me.Report I got:

\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP

testing\1226\2614-05.zip#\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#

So I'm not sure what to do next.

:

What is Me.Report?
Is it a textbox, which holds the full path/filename to a
file
you
want
to
move?
If not, it doesn't seem surprising that Access can't find
the
file
you
say
you want to move.
Is it perhaps in hyperlink form?
In that case, you'll probably need to parse out the
information
you
need.
I'd suggest putting
msgbox Me.Report
just before your FileCopy statement - that will show you
what
Access
sees in that control. If it's not obvious to you how to
parse
out
the
full
path/filename, post the contents of the messagebox, and
we'll
try to
help...

message
I guess I don't see how creating that message box for a
particular
file
will
help me create code that can apply to a wide range of
files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY
Reports
2006"
&
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm
starting to
reach
the
point of desperation. I can't find anyone who seems to
know
exactly
how
to
do it, and I am not well versed in code.

:

If your only problem is how to refer to a file name when
it
is
displayed
in
a control on a form (data is stored in fields in tables,
displayed
in
controls on forms), that's not too difficult.
Any data-bound control in Access has a .Value
property,
which
returns
the value it represents.
So, if your hyperlink is displayed in a textbox
named
HLink,
you
could
do this:
In the OnClick procedure of your button, type
something
like
this:
MsgBox HLink.Value
Now, when you click on the button, you should get a
little
gray
box
giving you the value of that textbox. I think
hyperlinks
are
stored
with
the value to display, a # sign, and the target of the
hyperlink,
but
this
will show you exactly what the syntax is.
You should then be able to figure out how to parse this
to
get
the
value
you
need.

HTH


"MichelleNH" <[email protected]>
wrote in
message

I don't think the real details are necessary, but here
are
the
basics.
I
have a single form with a single hyperlink with a
reference
number
as
its
primary key. This hyperlink is to a compressed (.zip)
file
stored
on
our
lab
server. At the discretion of our boss certain
hyperlinked
files
need to
be
saved in another folder on this server. I would
think
that
a
command
button could copy the hyperlinked file from one
location
and
save
 
M

MacDermott

I'd be real surprised if the file type had anything to do with it.
Perhaps you could put a breakpoint at your FileCopy line and see what values
are stored in LinkSource and LinkDestination.
Are they both valid pathnames?

MichelleNH said:
I modified it, but I got the same error anyways. Do you think this could
have something to do with the fact I'm copying a .zip file?

MacDermott said:
I'm afraid I don't know much about hyperlink shortcut menus, but it sort of
looks to me as if you may have some data stored as hyperlinks, and some just
as text strings.

You might want to change the function a little to account for this:
Dim HashPlace as long
HashPlace=Instr(HLink,"#")
If HashPlace=0 then
ExtractAddressFromHyperlink=Hlink
Else ExtractAddressFromHyperlink=left(HLink,HashPlace-1)
End If
End Function

HTH


MichelleNH said:
Okay, today I'm getting a file/path access error at the
FileCopy linksource, linkdestination line. I didn't knowingly change any
of the code (and I've just double checked it). I been having weird issues
with hyperlink shortcut menus disappearing, so nothing surprises me at this
point.
The value of me.Report is
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP testing\1226\2614-05.zip
:

What is the value of Me.Report when the error is generated?

It says the error is in the line:
linksource = ExtractAddressFromHyperlink(Me.Report)

:

Do you know what line of code is causing this error?

Okay, currently my error message is "Invaild use of null", I'm not
sure
what
I did to change that. My On Click Event Procedure is:

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

End Sub

The On Click field is indeed set to [Event Procedure]
Thanks again for your help!


:

Let me just make sure we're talking about the same thing:
When you say you modified the On_Click properties, do you
mean
that
you
changed the code which runs when you click the button?
(We usually call that the button's OnClick Event Procedure.)
Could you post the full code for that procedure, as it
stands
now?
Also, open the form in Design View, select the button, and verify in
its
Properties Page that OnClick is set to [Event Procedure].


Thanks! I put the function you sent me in a module and modified
the
On_Click
properties, however when I press the button nothing
happens.
Am
I
missing
(yet another) step?

:

Well, I'd guess that the address you want to extract is this:
\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip

You could write a little function like this:
Public function ExtractAddressFromHyperlink(HLink as
String)
as
String
Dim HashPlace as long
HashPlace=Instr(HLink,"#")
ExtractAddressFromHyperlink=left(HLink,HashPlace-1)
End Function

Then you can set your linksource like this:
linksource = ExtractAddressFromHyperlink(Me.Report)

HTH


message
Well, Me.Report is a text box bound to a field in a master
table
which
stores
a hyperlink. When I did the msgbox Me.Report I got:

\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP

testing\1226\2614-05.zip#\\Qc_pdc\pptd\Log\Reports\mhuddleston\MMP
testing\1226\2614-05.zip#

So I'm not sure what to do next.

:

What is Me.Report?
Is it a textbox, which holds the full path/filename to a
file
you
want
to
move?
If not, it doesn't seem surprising that Access can't find
the
file
you
say
you want to move.
Is it perhaps in hyperlink form?
In that case, you'll probably need to parse out the
information
you
need.
I'd suggest putting
msgbox Me.Report
just before your FileCopy statement - that will
show
you
what
Access
sees in that control. If it's not obvious to you how to
parse
out
the
full
path/filename, post the contents of the messagebox, and
we'll
try to
help...

message
I guess I don't see how creating that message box
for
a
particular
file
will
help me create code that can apply to a wide range of
files.

Here is what I have so far:
Dim linksource As String
Dim linkdestination As String
linksource = "Me.Report" '
linkdestination = "\\Qc_pdc\pptd\Log\Reports\FY
Reports
2006"
&
[ReferenceNo] & ".zip" '1
FileCopy linksource, linkdestination

I get a file not found error. Can you help? I'm
starting to
reach
the
point of desperation. I can't find anyone who
seems
to
know
exactly
how
to
do it, and I am not well versed in code.

:

If your only problem is how to refer to a file
name
when
it
is
displayed
in
a control on a form (data is stored in fields in tables,
displayed
in
controls on forms), that's not too difficult.
Any data-bound control in Access has a ..Value
property,
which
returns
the value it represents.
So, if your hyperlink is displayed in a textbox
named
HLink,
you
could
do this:
In the OnClick procedure of your button, type
something
like
this:
MsgBox HLink.Value
Now, when you click on the button, you
should
get a
little
gray
box
giving you the value of that textbox. I think
hyperlinks
are
stored
with
the value to display, a # sign, and the target
of
the
hyperlink,
but
this
will show you exactly what the syntax is.
You should then be able to figure out how to
parse
this
to
get
the
value
you
need.

HTH


"MichelleNH"
wrote in
message

I don't think the real details are necessary,
but
here
are
the
basics.
I
have a single form with a single hyperlink with a
reference
number
as
its
primary key. This hyperlink is to a
compressed
(.zip)
file
stored
on
our
lab
server. At the discretion of our boss certain
hyperlinked
files
need to
be
saved in another folder on this server. I would
think
that
a
command
button could copy the hyperlinked file from one
location
and
save
 
Top