Search all of Office.com
 
Support / Access / Access 2003 Help and How-to / Working with Data / Hyperlinks
 
 

About hyperlinks

Applies to: Microsoft Office Access 2003

 

Hyperlinks (hyperlink: Colored and underlined text or a graphic that you click to go to a file, a location in a file, a Web page on the World Wide Web, or a Web page on an intranet. Hyperlinks can also go to newsgroups and to Gopher, Telnet, and FTP sites.) provide a useful and convenient way to navigate between objects.

ShowWhat is a hyperlink?

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:

When you point to text or a picture that contains a hyperlink, the pointer becomes a hand Pointer in the shape of 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.

ShowParts of a hyperlink address

A hyperlink address (hyperlink address: The path to a destination such as an object, document, or Web page. A hyperlink address can be a URL (address to an Internet or intranet site) or a UNC network path (address to a file on a local area network).) 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 (control: A graphical user interface object, such as a text box, check box, scroll bar, or command button, that lets users control the program. You use controls to display data or choices, perform an action, or make the user interface easier to read.). 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 (Uniform Resource Locator (URL): An address that specifies a protocol (such as HTTP or FTP) and a location of an object, document, World Wide Web page, or other destination on the Internet or an intranet, for example: http://www.microsoft.com/.) or UNC (universal naming convention (UNC): A naming convention for files that provides a machine-independent means of locating the file. Rather than specifying a drive letter and path, a UNC name uses the syntax \\server\share\path\filename.) path to a document. For data access pages (data access page: A Web page, published from Access, that has a connection to a database. In a data access page, you can view, add to, edit, and manipulate the data stored in the database. A page can also include data from other sources, such as Excel.), 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 (Microsoft Access database: A collection of data and objects (such as tables, queries, or forms) that is related to a particular topic or purpose.) or .adp (Microsoft Access project: An Access file that connects to a Microsoft SQL Server database and is used to create client/server applications. A project file doesn't contain any data or data-definition-based objects, such as tables and views.) 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 (database: A collection of data related to a particular subject or purpose. Within a database, information about a particular entity, such as an employee or order, is categorized into tables, records, and fields.), 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.


You can type a hyperlink address directly in a hyperlink field (hyperlink field: A field that stores hyperlink addresses. In an Access database (.mdb), it's a field with a Hyperlink data type. In an Access project (.adp), it's a field that has the IsHyperlink property set to True.) in a datasheet or in a text box or control that accepts hyperlinks on a form or data access page.

 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.

ShowAbout the hyperlink control

Use the hyperlink control when each record in the underlying record source (record source: The underlying source of data for a form, report, or data access page. In an Access database, it could be a table, query, or SQL statement. In an Access project, it could be a table, view, SQL statement, or stored procedure.) 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 (Page view: An Access window in which you can browse the contents of a data access page. Pages have the same functionality in Page view as in Microsoft Internet Explorer 5.0 or later.) 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.

ShowImage hyperlink control

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

ShowWhat is a URL and how does it work?

When you create a hyperlink, its destination is encoded as a Uniform Resource Locator (URL (Uniform Resource Locator (URL): An address that specifies a protocol (such as HTTP or FTP) and a location of an object, document, World Wide Web page, or other destination on the Internet or an intranet, for example: http://www.microsoft.com/.)), 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 (Uniform Resource Locator (URL): An address that specifies a protocol (such as HTTP or FTP) and a location of an object, document, World Wide Web page, or other destination on the Internet or an intranet, for example: http://www.microsoft.com/.) 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 — you can simply browse to the page or file in a local web, network file system, or on the World Wide Web, and then FrontPage will provide the correct URL. When you create a hyperlink to a destination in the same web, FrontPage will create a relative URL. If you rename or move a file in a web, FrontPage will update all the URLs that point to the file. By generating relative URLs, FrontPage saves you time and ensures that your Web site will be portable.

ShowExamples 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 (Uniform Resource Locator (URL): An address that specifies a protocol (such as HTTP or FTP) and a location of an object, document, World Wide Web page, or other destination on the Internet or an intranet, for example: http://www.microsoft.com/.) use slash marks and UNC (universal naming convention (UNC): A naming convention for files that provides a machine-independent means of locating the file. Rather than specifying a drive letter and path, a UNC name uses the syntax \\server\share\path\filename.) 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.

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