Storing a Hyperlink

daft

New member
Local time
Today, 08:29
Joined
Aug 21, 2003
Messages
7
my Hyperlink hell!!!

hi guys

I'm having problems with a hyperlink.

Basically, I have a msg box that opens - when the name of a PDF is entered, my code adds the full UNC path to the name of the pdf and saves it as a hyperlink.

In theory, it works perfectly. When you enter "test.pdf", it saves it as a hyperlink with the name "\\ABCDEF\A\b\test.pdf"

BUT the problem is that the way my code works is it sets a variable, then stores the PDF location, then changes the textbox (with the hyperlink field as its control source) to reflect the variable.

For some reason, it stores the link in the backend table as a hyperlink, but it only stores it as the text for the hyperlink - when i click "edit hyperlink", there's no location there

(ie it saves it as a hyperlink, but doesn't actually save it as the link, just as text)

Does this make sense, and can anyone help?

thanks
Dave
 
Not totally sure I understand but it sounds like you agenerating a hyperlink and although the link looks absolutely correct it doesn't work.

If this is the case then change the bity that generates the hyperlink to add a # at each end.

Now you will not be able to see these #'s but the link should now work

Get back to me if it works please

Len
 
thanks Len, that works perfectly!!!! thanks very much, i've been baffled by this one for hours.

any reason why that # symbol has to be added?

thanks again
Dave
 
I ran into this some while ago and I was dealing with an application that was generating 40,000 hyperlinks. It drove me batting for a couple of days and then I actually found it in the Help. Never been able to find it since though,

Why is it needed. Have no idea except of course that it doesn't work without it.

Daft thing is is that if you use the wizard thingy to generate a single Hyperlink it works and you still do not see the #'s so comparing a wizardy hyperlink and an sql generated link gets you nowhere.

Glad it's all working

Cheers

Len B
 
I would change the data type in the table to a text field to store the hyperlinks. The use the Application.FollowHyperlink method to open value as a hyperlink.

HTH
 
ghudsen

Just from a matter of interest why would you use the Application.FollowHyperlink method to open value as a hyperlink.
 
The Application.FollowHyperlink method allows you to open the file [web site] from a text string. It avoids the common problems a lot of folks post about when dealing with opening files and websites when using hyperlinks. A simple example...

Dim sWebSite as String
sWebSite = "http://www.msn.com/"
Application.FollowHyperlink sWebSite

If you had a text field in your form named [WebSites] you could assign this simple command to a button to open the web site for the current record...

Application.FollowHyperlink WebSites

HTH
 
thanks ghudson - not a bad idea, the only flaw i can see with it is that storing it as a hyperlink means that if there is a link for that record then the link will displayed - if there isn't, then nothing is displayed (looks a little bit tidier imo)

whereas the way you've suggested, though it sounds feasible, will mean for us that most of the 5000 records will only have a blank text box and associated button.

a matter of preference i guess.

one thing that i am wondering about - can't think of a way of doing this right now, but could I use code to display the link as a pdf icon which would then open the link?

i guess this is where doing it the ghudson way might have helped, since i could just make the text box invisible and have some kind of code to say "if the record has a link, display button to open that link", and make the button a pdf icon...

hmmmmm!

thanks again anyway
Dave :)
 
Daft,

I have 100 softcopy invoices and a list of invoice numbers. I would like to create a hyperlink to every softcopy invoice by using the imported list of invoice numbers. I viewed your thread about "Storing a hyperlink" and it looks interesting to me. Do you think you can help me ?

Regards,

Fred.
 
changes to file wont save

Hi guys, I also have a program the saves pdf files and keeps the location as a hyperlink in a table. There is a form that is used to display data and a button to open the hyperlink. This works fine, but I cannot edit the pdf file, I can scan and insert files, however when I choose save to save the pdf it does nothing. Gives no errors at all, but when you close the link and open it the changes are lost. If I should use a save as to another location the changes are saved in the new location, but still not in the original file.

Regards
 

Users who are viewing this thread

Back
Top Bottom