How can i define hyperlink for TxtHyperlink by VBA ?

  • Thread starter Thread starter mezzanine1974
  • Start date Start date
M

mezzanine1974

There is a textbox (TxtHyperlink) on a form (Form1) which is bounded
to hyperlink type field (Hyp) in a table (Table1).
In a button click, I copy a file from somewhere to a new location.
How can i define hyperlink for TxtHyperlink by VBA by using new
location?
I searched this group, there are some information, but i failed to
finalize my code.
Could you help me please?
Thanks
 
Hi,
Assuming the file is on your computer and you have the file name and the
full path to the file.
The button click would add the file name with full path to your table.
You would do this using an append query.
Have I understood the problem?

Jeanette Cunningham
 
Hi,
Assuming the file is on your computer and you have the file name and the
full path to the file.
The button click would add the file name with full path to your table.
You would do this using an append query.
Have I understood the problem?

Jeanette Cunningham






- Show quoted text -

Hi
I have the file on my computer. I know the file name and full path.
Do you advise me to use append query?
Is there not any way to assing the hyperlink by VBA?
You understand the problem correct.
 
I thought you wanted to keep a permanant record of the copied file in your
table in the hyperlink field.
If you don't wish to do that, but only wish to open the file, you can go
Application.FollowHyperlink strFilePlusFullPath

Jeanette Cunningham


Hi,
Assuming the file is on your computer and you have the file name and the
full path to the file.
The button click would add the file name with full path to your table.
You would do this using an append query.
Have I understood the problem?

Jeanette Cunningham






- Show quoted text -

Hi
I have the file on my computer. I know the file name and full path.
Do you advise me to use append query?
Is there not any way to assing the hyperlink by VBA?
You understand the problem correct.
 
I thought you wanted to keep a permanant record of the copied file in your
table in the hyperlink field.
If you don't wish to do that, but only wish to open the file, you can go
    Application.FollowHyperlink strFilePlusFullPath

Jeanette Cunningham







Hi
I have the file on my computer. I know the file name and full path.
Do you advise me to use append query?
Is there not any way to assing the hyperlink by VBA?
You understand the problem correct.- Hide quoted text -

- Show quoted text -

Hello Jenaette,

I wanted to keep a permenant record of the copied file. Then, I want
to be able to access all copied files in their new locations.
I will be appreceated if you can fix that.

Thanks.
 
You would need to append the new file name and full path to the table - in
the hyperlink field.
Do you have the code to browse to a location and retrieve the name of the
file and its path?

Jeanette Cunningham
 
Let me summarize as follow:

This line of code yields only File Name which is copied to new
location from "E:\MyPrivateFiles\Purchase\BackUp\" >>

FileName = Dir("E:\MyPrivateFiles\Purchase\BackUp\" +
HyperlinkPart(Me.TxtLinkToInvoice.Value, acDisplayedValue))

This line of code yields full path of new location including file
name. Because I have already copied file into new location "\
\mer_rus_1\Estimating\" >>

FullPathName = "\\mer_rus_1\Estimating\" & FileName

I dont have any problem to find out the file name and new location of
copied file. The codes above can provide me that. I dont know how I
can assign hyperlink to "FullPathName" and how i can store permenantly
into a table field!

Did i make it clear?
 
Application.FollowHyperlink(FullPathName)

This is all what i need. It took 1 week to understand that.

Thanks Jeanette anyway.
 
Back
Top