Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hyperlink in MS Access report

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?

like image 803
Gentle153 Avatar asked Nov 04 '14 13:11

Gentle153


People also ask

How do you hyperlink in Microsoft Access?

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.

What does hyperlink mean in Access?

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 the use of hyperlink data type in MS Access?

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).


1 Answers

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

OriginalDesign.png

and it displayed the URL as expected.

WithSiteURL.png

To display the SiteName as a hyperlink I just edited the control source to prepend the site name to the #-delimited hyperlink text

ModifiedDesign.png

and the Text Box now displays the SiteName as a link to the URL...

enter image description here

... because the Text Box (where the hand cursor is pointing) now contains

Stack Overflow#http://stackoverflow.com/#
like image 178
Gord Thompson Avatar answered Sep 28 '22 15:09

Gord Thompson