link a file to a image

Real Wally

Registered User.
Local time
Today, 23:16
Joined
Jan 28, 2003
Messages
107
Hi All,

I'd like to be able to open a pdf format document by clicking on a small pdf icon. How do I do that?
What I've done so far is insert the pdf icon as a bitmap image in one column and store the URL of the pdf document in the column next to it (hyperlink type). The URL works fine when I
How do I now make both fields work together?

Thanks,

Walter
 
Don't worry about the hyperlink text field if its a static address.

Instead put this code behind the onclick event of the .bmp image.

Code:
  Me.TopPic.HyperlinkAddress = "C:\myDir\myPDF.pdf"
  Me.TopPic.Hyperlink.Follow

Make sure to set the hyperlink address to your desired address. Or, if you are storing the address in a text box..

Code:
  Me.TopPic.HyperlinkAddress = Forms!MyForm!txtMyHyperLink.Value
  Me.TopPic.Hyperlink.Follow

Either method should get you where you want to go..
 
Thank you Sambo.
I haven't been able to get it to work yet but must admit that haven't had a chance to play around with it extensively yet. Hopefully later today.
I'll report back how I go with this.

Thanks again,

Walter
 
Just so you know..

TopPic should be replace by the name of your image container. TopPic just happens to be the name I was using on my form. Same with txtMyHyperLink
 
OK! I feel like a real Wally again! Thanks for pointing out what must have been obvious to most, but not to me. One day I'll get it too, maybe...
 

Users who are viewing this thread

Back
Top Bottom