Share via


HyperlinkSubAddress Property [Access 2003 VBA Language Reference]

You can use the HyperlinkSubAddress property to specify or determine a location within the target document specified by the HyperlinkAddress property. Read/write String.

expression.HyperlinkSubAddress

expression Required. An expression that returns one of the objects in the Applies To list.

Remarks

The HyperlinkSubAddress property can be an object within a Microsoft Access database, a bookmark within a Microsoft Word document, a named range within a Microsoft Excel spreadsheet, a slide within a Microsoft PowerPoint presentation, or a location within an HTML document.

The HyperlinkSubAddress property is a string expression representing a named location within the target document specified by the HyperlinkAddress property.

You can set the HyperlinkSubAddress property by using a control's property sheet , a macro , or Visual Basic .

You can also use the Insert Hyperlink dialog box to set this property by clicking the Build button to the right of the property box in the property sheet.

Note  When you create a hyperlink by using the Insert Hyperlink dialog box, Microsoft Access automatically sets the HyperlinkAddress property and HyperlinkSubAddress to the location specified in the Type the file or Web page name box. The HyperlinkSubAddress property is set to the location specified in the Select an object in this database box.

When you move the cursor over a command button, image control, or label control whose HyperlinkSubAddress property is set, the cursor changes to an upward-pointing hand. Clicking the control displays the object or Web page specified by the link.

To open objects in the current database, leave the HyperlinkAddress property blank and specify the object type and object name you want to open in the HyperlinkSubAddress property in the format "objecttype objectname". For example, to create a hyperlink for a command button that opens the Employees form you could set the control's HyperlinkSubAddress property to "Form Employees". If you want to open an object contained in another Microsoft Access database, enter the database path and file name in the HyperlinkAddress property and specify the database object to open by using the HyperlinkSubAddress property.

Note  When you follow a hyperlink to another Microsoft Access database object, the database Startup properties are applied. For example, if the destination database has a Display form set, that form is displayed when the database opens.

The following table contains shows examples of HyperlinkAddress and HyperlinkSubAddress property settings.

HyperlinkAddress HyperlinkSubAddress Description
http://www.microsoft.com/ The Microsoft home page on the Web.
C:\Program Files\Microsoft Office\Office\Samples\Cajun.htm The Cajun Delights page in the Access sample applications subdirectory.
C:\Program Files\Microsoft Office\Office\Samples\Cajun.htm NewProducts The "NewProducts" Name tag in the Cajun Delights page.
C:\Personal\MyResume.doc References The bookmark named "References" in the Microsoft Word document "MyResume.doc".
C:\Finance\First Quarter.xls Sheet1!TotalSales The range named "TotalSales" in the Microsoft Excel spreadsheet "First Quarter.xls".
C:\Presentation\NewPlans.ppt 10 The 10th slide in the Microsoft PowerPoint document "NewPlans.ppt".

Applies to | CommandButton Object | Image Object | Label Object

See Also | Hyperlink Property | HyperlinkAddress Property | HyperlinkPart Method | SubAddress Property