Understanding Access 97's Hyperlink Field Data Type

Access 97 adds a new member, Hyperlink, to its repertoire of field data types. Hyperlink isn't a Jet 3.5 data type, because Jet 3.5 stores Access Hyperlink values in Memo fields. Access 97's Hyperlink data type simply interprets the value of the Memo field as a hyperlink and formats the display accordingly.

A Hyperlink field value may consist of the following three components:

  • Display text, an optional descriptive name for the hyperlink that appears as emphasized text, usually underlined and having a distinctive color.

  • Address, a required reference to the location of a related document. The reference can be an Internet URL for World Wide Web and FTP (File Transfer Protocol) sites, a relative or fully qualified path and file name, or a file on a network server specified by UNC (Uniform Naming Convention).

  • Subaddress, an optional reference to a named location in a related document, such as a bookmark in a Word or HTML document, or a named range in an Excel worksheet.

Individual components of Hyperlink values are separated by the pound sign (#), the same delimiter used for Jet date values. Following are examples of typical Hyperlink values:

  • Microsoft Web Site# http://www.microsoft.com displays Microsoft Web Site in the text and jumps to the home page of http://www.microsoft.com when clicked.

  • Yen Conversion#c:currency1996dec.xls#Yen displays Yen Conversion and points to the c:currency1996dec.xls file's Yen named range.

  • #\Server1DocumentsReports1996sales.doc#Drugs displays and points to the Drugs bookmark in the 1996sales.doc Word document in the shared DocumentsReports folder of Server1. If you don't include a display text value, the address and subaddress values are displayed.

  • ##frmProducts points to the frmProducts form in the currently open database.

Testing Hyperlinks in the Northwind Orders Table

Northwind.mdb's Suppliers table (see Figure 16.4) includes a Home Page Hyperlink field that includes links to Web pages located in your Program FilesMicrosoft OfficeOfficeSamples folder and to placeholder pages at http://www.microsoft.com/accessdev/sampleapps. Hyperlinks stored in tables are useful for creating searchable databases for storing links to your favorite Web sites. Hyperlinks in tables also offer automatic navigation assistance within large corporate intranets. For example, you can create a table with document names, keywords, and other identifying information, and then use a query to locate and display only those documents meeting criteria you establish.

Figure 16.4. The Home Page Hyperlink field of Northwind.mdb's Suppliers table.


The CAJUN.HTM and FORMAGGI.HTM hyperlinks point to individual Cajun.htm and Formaggi.htm files, respectively, with relative paths. Clicking either hyperlink opens Internet Explorer 3.0 (or another browser that you've specified as your default browser) to display the file. Figure 16.5 shows Cajun.htm open in Internet Explorer 3.0. If you click one of the links with (on the World Wide Web) in the display text, your browser connects to the Web site and opens the specified page.

Note

When you open IE 3.0 from an Access 97 hyperlink, Access automatically minimizes. Each hyperlink you click opens another independent instance of IE 3.0 to display the page. Microsoft claims that this behavior is "by design," but hasn't explained the reason for opening multiple instances of IE 3.0.


Editing and Inserting Conventional Hyperlinks

To edit an existing hyperlink value or add a new hyperlink to a table, right-click a cell in a Hyperlink field to open the pop-up menu, and then choose Edit Hyperlink from the Hyperlink menu (see Figure 16.6) to open the Edit Hyperlink dialog. Figure 16.7 shows the URL entry for the Plutzer home page located on the Microsoft Web site. If you're creating a new hyperlink, type the Internet URL of the page in the Link to File or URL drop-down combo box. Alternatively, you can open the drop-down list and select from prior URLs that you've opened in IE 3.0. To link to a file, click the Browse button to open the Link to File dialog and select the file for the link.

Figure 16.5. The home page for the Cajun Delights (Cajun.htm) hyperlink of the Suppliers table opened in Internet Explorer 3.0.


Figure 16.6. The pop-up menu and submenu for editing or creating a hyperlink value.


Note

You can edit the display text element of the hyperlink value in the text box of the pop-up submenu that opens when you choose Hyperlink from the first pop-up menu (refer to Figure 16.6).


Figure 16.7. The Edit Hyperlink dialog, with an entry for a hyperlink to a page on the World Wide Web.


Linking to Bookmarks in a Word Document

To create a link to an existing Word document having one or more bookmarks that uses a hyperlink subaddress to locate a specific bookmark in the document, follow these steps:

1.
Create a new table with at least one Text field to identify the subject matter and a Hyperlink field to contain the links to the bookmarks. Open the new table in Datasheet view.

2.
Type the description in the text field and move to the Hyperlink field, but don't enter display text.

Note

If you enter display text in the Hyperlink field, an http: // URL prefix is added to the display text to create a default URL in the Edit Hyperlink dialog's Link to URL or File combo box. This isn't helpful when you want to link to a file.

3.
Right-click the empty cell in the Hyperlink field, and then choose Edit Hyperlink from the Hyperlink menu to open the Edit Hyperlink dialog.

4.
Click the Browse button to the right of the Link to URL or File combo box to open the Link to File dialog (see Figure 16.8). Select the .doc file to link and click OK to close the dialog. The fully qualified path to the selected file appears in the Link to URL or File combo box (see Figure 16.9).

Figure 16.8. Specifying the file for a hyperlink in the Link to File dialog.


Figure 16.9. The full path to the file displayed in the URL or File to Link combo box.


5.
Type the name of the bookmark in the Named Location in File text box. If you want to use the relative path to the file, mark the Use Relative Path for Hyperlink check box (see Figure 16.10). A relative path is most useful when your document is in the same folder as the Access .mdb file; in this case, only the file name appears in the Path label. Click OK to close the Edit Hyperlink dialog.

Figure 16.10. Specifying a bookmark for the hyperlink in the Word .doc file and the use of a relative path for the link to the file.


Note

You can't use the Browse button next to the Named Location in File text box to display a list of bookmarks in Word .doc files or named ranges in Excel worksheets. The Browse button displays only objects in the currently open Jet database.

6.
The file name (address element of the hyperlink value) appears in the Hyperlink cell of the table (see Figure 16.11). If you want display text rather than the file name to appear in the cell, right-click the cell, choose Hyperlink, and type the entry in the Display Text text box of the pop-up menu (refer to Figure 16.6).

Note

If you type over the file name in the current cell of the Hyperlink field that displays the file name, you replace the address element. Thus, you must make the change in the pop-up menu's Display Text text box.

7.
When you click the new hyperlink entry, Word 97 opens the specified .doc file and positions the caret to the bookmark name you entered in step 5 (see Figure 16.12).

Figure 16.11. A hyperlink entry without display text showing the address of the file (Dv_1394.doc).


Figure 16.12. The hyperlinked document opened in Word 97 with the caret positioned at the specified bookmark.


8.
Click the Back button of Word's Web toolbar to return to Access.

9.
Click the Forward button of Access's Web toolbar to return to Word and the open document.

10.
Close Word when you're finished experimenting.

This procedure also applies to Excel worksheets and PowerPoint presentations. Specify the name of an Excel 97 range or the number of a PowerPoint slide in the Named Location in File text.

Specifying Hyperlinks to Pages on an Intranet Server

You can establish links to pages on an intranet server by using the following generalized URL format:

http://servername/folder[/pagename.htm]

For example, to specify a link to the default page of the FireWire subfolder of the InetPubwwwroot folder for Internet Information Server 2.0+ running on a server named OAKLEAF0, type http://oakleaf0/firewire in the Link to URL or File text box. Alternatively, you can specify a particular page in the folder, such as .../1394wire.htm (see Figure 16.13). To define a jump to an anchor (the term for the HTML equivalent of a bookmark) in the Web page, type the anchor name in the Named Location in File text box. Figure 16.14 shows IE 3.0 displaying the 1394wire.htm file, which was created in Word 97 to save the Dv_1394.doc file in HTML format.

Figure 16.13. Specifying a hyperlink jump to a page on an intranet server.


Using Hyperlinks to Open an Access Object

In addition to using hyperlinks to open documents in IE 3.0, Word 97, Excel 97, or PowerPoint 97, you can specify an object to open in an Access 97 database file. For example, you can open a designated form in the Solutions.mdb database by following these steps:

1.
Open the Suppliers table of Northwind.mdb and move to an empty cell in the Home Page field.

2.
Right-click the empty Hyperlink cell and choose Edit Hyperlink from the Hyperlink menu to open the Edit Hyperlink dialog.

3.
Click the upper Browse button, select Solutions. mdb, and click OK to specify the Solutions database as the address of the hyperlink (see Figure 16.15).

Figure 16.14. A Web page displayed by making the jump to a document stored on an intranet server.


4.
Click the lower Browse button to open the Select Location dialog, a modal version of the Database window that displays the objects in the selected .mdb file.

5.
Click the Forms tab and select one of the forms in Solutions.mdb, such as the SolutionsHyperForm (see Figure 16.16). Click OK to close the Select Location dialog.

Figure 16.15. An Access .mdb file specified as the address of a hyperlink.


Figure 16.16. Selecting the Access object to open in a hyperlinked .mdb file.


6.
The type of object (Form in this case) followed by a space and the name of the object appears in the Named Location in File text box (see Figure 16.17). Click OK to close the Edit Hyperlink dialog.

Figure 16.17. Selecting the Access object to open in a hyperlinked .mdb file.


7.
Click the new hyperlink. A second instance of Access launches, opens Solutions.mdb, and then opens the SolutionsHyperForm form (see Figure 16.18). You might need to close the Solutions splash screen to make the form visible.

8.
Click the Exit button to close Solutions.mdb, close the second instance of Access, and clear the test hyperlink value you created.

Figure 16.18. The SolutionsHyperForm form opened by the hyperlink of Figure 16.17.


Note

Access 97 uses Windows dynamic data exchange (DDE) to process Hyperlinks to applications that reside on your PC. The address component of the hyperlink value corresponds to DDE's TopicName argument of the DDEInitiate command; the ServiceName argument is derived from the file extension. The subaddress component corresponds to the ItemName argument of the DDERequest command.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.172.252