I've made an MS Access 2013 database to keep track of all communications regarding a trading website. The tables and columns relevant to this question are Advertisements with columns ID (Number) and Link (Hyperlink), and Notes with column Advertisement, which contains an Advertisement ID. The Link field contains an http link to the advertisement on the website.
It is easy to include the Link column in reports, but to save space, I would like to turn the ID field into a hyperlink with the ID as displayed text and the contents of the Link column as the target. How would I go about that?
I already played a little with the properties of the ID column and set "Is Hyperlink" to true and "Hyperlink target" to "SELECT '#' & Link & '#' AS URL FROM Advertisements", but this didn't work. It may need a WHERE clause, but how would I refer to the value of the ID field of the record in question?
Right-click the document tab for the new table and click Design View. In the Field Name column, select the first blank row, and then type a name for the field. Select the adjacent cell in the Data Type column, and then select Hyperlink from the list. Save your changes.
In computing, a hyperlink, or simply a link, is a reference to data that the user can follow by clicking or tapping. A hyperlink points to a whole document or to a specific element within a document. Hypertext is text with hyperlinks.
What is behind the Hyperlink data type? Storing data in a Hyperlink column will change the data you entered. The Hyperlink datatype is not plain text. It is a composite data type consisting of a DisplayText, the Address and optionally a SubAddress and a ScreenTip (Tool tip).
To illustrate, I created a table named [LinkTest] with columns
ID - AutoNumber, Primary Key
SiteName - Text(255)
SiteURL - Hyperlink
and data
ID SiteName SiteURL
-- -------------- ---------------------------
1 Stack Overflow #http://stackoverflow.com/#
2 YouTube #http://www.youtube.com/#
I created a new Report with a Text Box for the URL
and it displayed the URL as expected.
To display the SiteName as a hyperlink I just edited the control source to prepend the site name to the #
-delimited hyperlink text
and the Text Box now displays the SiteName as a link to the URL...
... because the Text Box (where the hand cursor is pointing) now contains
Stack Overflow#http://stackoverflow.com/#
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With