5
votes

One field of the table is a memo field that contains the full path of a file.

I am to display the path as a hyperlink in a form in datasheet view.

This is what I have done in the Property window for that column:

  • Is Hyperlink: Yes
  • Display as Hyperlink: Always

Now the value of that column does display like a hyperlink, in blue color and with a underline. But if I click the hyperlink, it does not take me to anywhere.

There is a property named "Hyperlink Target", which I think must be the place to fix that. But nowhere can I find documentation for the value for this property. I tried "_blank" as if it were Html, but it fails. Can anyone tell me what is supposed to be in that property so that the hyperlink will work?

Thank you!

3

3 Answers

5
votes

In your form's record source query, concatenate a hash character (#) to both ends of the memo field value.

SELECT '#' & your_field & '#' AS URL
FROM YourTable;

Then if your field contained https://www.google.com/webhp?source=search_app, the text box value would be #https://www.google.com/webhp?source=search_app#. And clicking the text box bound to that URL would use the FollowHyperlink method to open it in the associated application.

If you're talking about a local file path rather than a web URL, that method will still work.

4
votes

Are you really attached to this idea? I would not recommend it because it makes editing the data a nuisance. I prefer FollowHyperlink in the double-click event. FollowHyperlink will open most things:

 FollowHyperlink "c:\docs\word.doc"
 FollowHyperlink "mailto:[email protected]"
 FollowHyperlink "http://stackoverflow.com
 FollowHyperlink Me.MyDocs
0
votes

I've been trying to figure this out with additionally adding a field into it. The solution I found was to write a SQL Update Query:

UPDATE TableName
SET Yahoo = [FieldName]&'.Y'&"#"&"http://finance.yahoo.com/q?s="& [FieldName] & "&ql=0"&"#"
WHERE [FieldName]IS NOT NULL

My specific use was for linking to Stock Tickers, but it could be used for other purposes. The issue that this solved for me was Access erroring out thinking the "#" was for a date.