expression.HyperlinkPart(Hyperlink, Part)
expression Required. An expression that returns one of the objects in the Applies To list.
Hyperlink Required Variant. A Variant representing the data stored in a Hyperlink field.
Part Optional AcHyperlinkPart . The value for the part argument is an intrinsic constant representing the information you want returned by the HyperlinkPart method.
AcHyperlinkPart can be one of these AcHyperlinkPart constants. |
acAddress. The address part of a Hyperlink field. |
acDisplayedValue default. The underlined text displayed in a hyperlink. |
acDisplayText. The displaytext part of a Hyperlink field. |
acFullAddress. The address and subaddress parts of a Hyperlink field delimited by a "#" character. |
acScreenTip. The tooltip part of a Hyperlink field. |
acSubAddress. The subaddress part of a Hyperlink field. |
Remarks
You use the HyperlinkPart method to return one of three values from a Hyperlink field or the displayed value. The value returned depends on the setting of the part argument. The part argument is optional. If it's not used, the function returns the value Microsoft Access displays for the hyperlink (which corresponds to the acDisplayedValue setting for the part argument). The returned values can be one of the four parts of the Hyperlink field (displaytext, address, subaddress, or screentip), the full address, address#subaddress, or the value Microsoft Access displays for the hyperlink.
Note If you use the HyperlinkPart method in a query, the part argument is required and you can't use the constants listed above but must use the actual value instead.
When a value is provided in the displaytext part of a Hyperlink field, the value displayed by Microsoft Access will be the same as the displaytext setting. When there's no value in the displaytext part of a Hyperlink field, the value displayed will be the address or subaddress part of the Hyperlink field, depending on which value is first present in the field.
The following table shows the values returned by the HyperlinkPart method for data stored in a Hyperlink field.
Hyperlink field data | HyperlinkPart method returned values |
---|---|
#http://www.microsoft.com# | acDisplayedValue: http://www.microsoft.com
acDisplayText: acAddress: http://www.microsoft.com acSubAddress: acScreenTip: acFullAddress: http://www.microsoft.com |
Microsoft#http://www.microsoft.com# | acDisplayedValue: Microsoft
acDisplayText: Microsoft acAddress: http://www.microsoft.com acSubAddress: acScreenTip: acFullAddress: http://www.microsoft.com |
Customers#http://www.microsoft.com#Form Customers | acDisplayedValue: Customers
acDisplayText: Customers acAddress: http://www.microsoft.com acSubAddress: Form Customers acScreenTip: acFullAddress: http://www.microsoft.com#Form Customer |
##Form Customers#Enter Information | acDisplayedValue: Form Customers
acDisplayText: acAddress: acSubAddress: Form Customers acScreenTip: Enter Information acFullAddress: #FormCustomer |
When you add an address part to a Hyperlink field by using the Insert Hyperlink dialog box (available by clicking Hyperlink on the Insert menu) or by typing an address part directly into a Hyperlink field, Microsoft Access adds the two # symbols that delimit parts of the hyperlink data.
You can add or edit the displaytext part of a hyperlink field by right-clicking a hyperlink in a table, form, or report, pointing to Hyperlink on the shortcut menu, and then typing the display text in the Text to display box.
When you add data to a Hyperlink field directly, you must include the two # symbols to delimit the parts of the hyperlink data.