A hyperlink is a pointer from one object to another. The destination is frequently another Web page, but it can also be a picture, an e-mail address, a file (such as a multimedia file or Microsoft Office document), or a program. The hyperlink itself can be displayed as text or as a picture.
You can use hyperlinks to do the following:
-
Navigate to a file or Web page on a network, intranet, or Internet
-
Send an e-mail message
-
Start a file transfer, such as downloading or an FTP process
When you point to text or a picture that contains a hyperlink, the pointer becomes a hand , indicating that it is something you can click on.
When a site visitor clicks the hyperlink, the destination is displayed, opened, or run, depending on the type of destination. For example, a hyperlink to a sound file opens the file in a media player, and a hyperlink to a Web page displays the page in the Web browser.
A hyperlink address can have up to four parts that are separated by the number sign (#):
displaytext#address#subaddress#screentip
Part | Description |
---|---|
displaytext | The text that you see in the field or control. For example, you might want to display a descriptive name for the World Wide Web site or object specified by the address and the subaddress. This is an optional field. |
Address | An absolute or relative path to a target document. An absolute path is a fully qualified URL or UNC path to a document. For data access pages, a relative path is a path that is related to the saved location of the page. For other database objects, a relative path is a path that is related to the Hyperlink Base setting in the DatabaseName Properties dialog box or to the current database path. This is an optional field as long as subaddress points to an object in the current .mdb or .adp file. |
subaddress | The location in the file or page. For example, you might want to point to a particular form or report in a Microsoft Access database, or to a particular bookmark in a Microsoft Word document. This is an optional field. |
screentip | The text that appears when you rest the pointer on a hyperlink. This is an optional field. |
Note In a field or text box that formats the hyperlink address as a hyperlink, Microsoft Access doesn't display all four parts in the field or control. If you want to see the whole hyperlink address, select the insertion point and press F2.
- If you enter displaytext, Access doesn't show any of the rest of the address following the display text.
- If you don't enter displaytext, Access displays just the address.
- Subaddress is displayed only if there is no displaytext or address.
- The ScreenTip that is displayed for a hyperlink on a data access page is defined for the hyperlink control, so a ScreenTip that you enter as part of the address won't be displayed on the data access page.
Use the hyperlink control when each record in the underlying record source has a different hyperlink address. You bind the hyperlink control to a Text field that contains hyperlink values, such as e-mail addresses.
As you move from record to record in Page view or Microsoft Internet Explorer, you can click the hyperlink to either go to a different Web page or open a mail program to send an e-mail message.
Use the image hyperlink control to add an image to a data access page that, when clicked, displays another Web page from your hard drive, the Web, or another location. When you create an image hyperlink control, you select the image to display on the page and the address of the file to jump to. In Page view, as the pointer passes over the image, the pointer changes to a hand, indicating that the image is a link that you can click to go to another page. You can also define ScreenTips and alternate text for the image.
The image hyperlink control is useful for providing links to information that relates to data on your data access page
What is a URL and how does it work?
When you create a hyperlink, its destination is encoded as a Uniform Resource Locator (URL), such as http://example.microsoft.com/news.htm or file://ComputerName/SharedFolder/FileName.htm. A URL contains a Web server or network location path and file name. A URL also identifies the protocol that will handle the file, such as HTTP, FTP, or FILE.
What is the difference between an absolute and a relative hyperlink?
An absolute URL contains the full destination address. A relative URL has one or more missing address parts. To make the address usable, the missing information is taken from the page that contains the URL. For example, if the protocol and domain are missing, the Web browser uses the protocol and domain of the current page. It is common for pages in a Web site to use relative URLs containing only a partial path and file name. If the files are moved to another server, any hyperlinks will continue to work as long as the relative positions of the pages remain unchanged. For example, a hyperlink on Products.htm points to a page in the same folder; if both pages are moved to the same folder on a different server, the URL in the hyperlink will still be correct.
When you create hyperlinks in Microsoft FrontPage, you do not need to know the destination URL
Examples of hyperlink addresses
Note A hyperlink address can have up to four parts that are separated by the number sign (#): displaytext#address#subaddress#screentip
The following examples display the hyperlink address and what they point to. Note that URLs use slash marks and UNC paths use backslashes.
Microsoft Corporation#http://www.microsoft.com#
The Microsoft home page on the Web. Displayed as "Microsoft Corporation."
#http://www.microsoft.com#
The Microsoft home page on the Web.
#http://www.microsoft.com#sample#
The Name tag called "sample" in the .html document for the Microsoft home page. Name is an attribute of some tags in HTML pages.
#\\northwind\public\products.doc##List of discounted products
A Microsoft Word file called Products.doc in the public folder on the Northwind server. The ScreenTip is "List of discounted products."
Resume#c:\windows\personal \resume.doc#
A Word file called Resume.doc located in the C:\Windows\Personal folder. Displayed as "Resume."
#c:\windows\personal\resume.doc#
The same Resume.doc file located in the C:\Windows\Personal folder. The path name will be displayed because there's no display text.
#c:\windows\personal\resume.doc#Qualifications
The bookmark called "Qualifications" in the Resume.doc file.
#c:\windows\personal\ northwind.mdb#Form Suppliers
The Suppliers form in the Northwind database, located in the C:\Windows\Personal folder.
Suppliers##Form Suppliers#Click to view and edit supplier information
The Suppliers form in the current database. Displayed as "Suppliers," with the ScreenTip "Click to view and edit supplier information."
#c:\windows\personal\1996 Sales.ppt#13
Slide 13 in the 1996 Sales.ppt PowerPoint presentation in the C:\Windows\Personal folder.
#c:\windows\personal\budget. xls#Sheet1!A2
Cell A2 in Sheet1 of the budget.xls Excel file, located in the C:\Windows\Personal folder.
To make it easier to enter a hyperlink address, Access allows you to omit certain parts of an address. For example:
- If you type http://example.microsoft.com, Access recognizes the "http:" protocol and translates the address to #http://example.microsoft.com#. (You don't have to enter the number signs (#) yourself.)
- If the text that you enter doesn't include a number sign (#), a protocol (such as "http:"), or a reference to an object in the current database, Access assumes the text entered is display text and appends "http://" to the same text for the address. For example, if you type example.microsoft.com, Access translates the address as example.microsoft.com#http://example.microsoft.com#.
- If you want to point to an Access object in the current database, you can specify just the object name that you want to link to
— you don't have to specify a UNC path. If there are multiple objects with the same name, Access uses the following order to determine which one to reference: forms, reports, queries, tables, data access pages, macros, modules, views, schemas, stored procedures, SQL linked tables, linked tables, and triggers. If, for example, there is both an Orders form and an Orders table, Access assumes that the reference is to the Orders form. You can specify a particular object type by entering object type object name. So to refer to the Orders table instead of the Orders form, enter table Orders as the subaddress. For object types with multiple words, omit the spaces between words; for example, enter dataaccesspage Orders.
Some hyperlink subaddress syntax examples in Office
To go to location in this type of file | Enter |
---|---|
Microsoft Access | The object type and object name. For example, enter table Customers to go to the Customers table.
Notes On a non-English system, Access recognizes the object type in English and in the local language; however, hyperlinks created by using the Insert Hyperlink dialog box all have the English-language string for an object type. |
Microsoft Excel | A defined name or a sheet!range. For example, enter Sheet1!A2 to go to the A2 cell in Sheet1. |
Microsoft PowerPoint | A slide number |
Microsoft Word | A bookmark name |
HTML document | A bookmark name (defined by using the NAME attribute of the <A> tag) |