Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clicking on text in a form to open a .doc or .xls or .pdf 1

Status
Not open for further replies.

tontenn

Vendor
Joined
Dec 29, 2006
Messages
54
Location
AU
Good Afternoon Guys.

Another question. Painfully easy as it might seem to you all, to me its been bugging me all day.

I have a table listing documents in a folder on our server. I have created a form with the "PrimaryKey" "Title" "Descrip" and a field calle "Link" which lists the path to the file on the server.

How can I click on this field record "Link" and then that open up the required document.

When i make the field a hyperlink it just tries to open it in IE or gives me an error message. There must be a simple answer.

Thanks in advance.

Cheers

Tones
 
You can FollowHyperlink:

[tt]FollowHyperlink Me.txtFile
FollowHyperlink "C:\Docs\Tek-Tips.xls"[/tt]

It will open the file in the application which is registered to handle the file extension.

I greatly dislike hyperlink fields, but find FollowHyperlink very useful.
 
Thanks as usual RoyVidar and Remou.

Looked at yours Roy and thought I better not try it as I might stuff something up. So I went with remou's first up and it worked like a dream.

Thank you so much.

Cheers
Tones
 
Hi Remou and Team Im back with a continuing question in regard to this issue.

I have now created a new table and a new form within the database above and wished to do the same thing, click on the path to take me to the form on our server.

Followed all instructions as before and in the click event pasted the code

Private Sub Path_Click()
FollowHyperlink Me.Path

End Sub

When I go back to the form and test it the first record in the form with a path like this "\\Csc-server\Common\CSC\STANDARD\CSC - IMS\Section 3 - Forms\" goes straight to the folder. Which is exactly what I want.

But every other path in the form, and ill give you one as an example "\\Csc-server\common\CSC\STANDARD\CSC - IMS\Section 3 - Forms\Plant & Equip Service Report.doc", fails to load and comes up with an error

"Runtime Error 490" Cant open the specified file. and then when i press debug it just highlights in yellow "FollowHyperlink Me.Path".

Its really strange and cant work out why it worked perfectly for all the previous forms and the first record in this form and then not for anything else.

I hope you or someone can help.

Regards

tones
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top