ACC97: Hyperlink Is Not Displayed as Expected in Report Header (191100)
The information in this article applies to:
This article was previously published under Q191100 Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
When you place a Hyperlink field in a report header or section header, it
may not be displayed in the proper format. The text box is displayed with
number signs (#), as shown below, instead of just "Display Text" or "Link
to File or URL:"
- "Display Text#Link to File or URL#Named Location In File"
-or-
- "Display Text#Link to File or URL#
-or-
- "#Link to File or URL#Named Location In File"
-or-
- "#Link to File or URL#"
RESOLUTIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
You can use the following function to eliminate the unwanted number signs.
- Open the sample database Northwind.mdb.
- Create a module and type the following line in the Declarations
section:
Option Explicit
- Type or paste the following procedure into the module:
Public Function FParseHyperlink(strHyp As String) As String
' Determine if there is a '#' sign in the field.
If InStr(1, strHyp, "#") > 0 Then
' Check the first character of the hyperlink.
' If it is a '#', then no Display Text has
' been entered for the hyperlink; output the
' Link to File URL.
If Left(strHyp, 1) = "#" Then
If InStr(1, Right(strHyp, Len(strHyp) - 1), "#") Then
FParseHyperlink = Left(Right(strHyp, Len(strHyp) - 1), _
InStr(1, Right(strHyp, Len(strHyp) - 1), "#") - 1)
End If
Else
' If the first character was something other than '#',
' output the Display Text for field.
FParseHyperlink = Left(strHyp, InStr(1, strHyp, "#") - 1)
End If
End If
End Function
- On the File menu, click Save. Type HyperlinkFunction, and then click OK.
To test this function, follow these steps:
- In the Database window, click the Tables tab and select the Suppliers table. On the Insert menu, click Report. Click AutoReport: Columnar, and then click OK.
- On the View menu, click Design View.
- On the View menu, click Sorting And Grouping.
- In the Sorting And Grouping dialog box, select SupplierID from the Field/Expression box, and set the following properties:
Group Header: Yes
- Add a text box to the SupplierID header section of the report,
and set the following properties:
Control Source: =IIf(IsNull([HomePage])=False,FParseHyperlink([HomePage]))
Fore Color: 16711680
Font Underline: Yes
- On the File menu, click Save. Type Hyperlink-Format, and then click OK.
- On the File menu, click Print Preview.
The new text box will look like a hyperlink and is displayed in the proper
format. Although the field looks like a hyperlink, it does not function as
a hyperlink because hyperlinks are not clickable on a report.
STATUS
Microsoft has confirmed this to be a problem in Microsoft Access 97
REFERENCES
For more information about creating hyperlinks, search the Help Index for
"hyperlink fields," or ask the Office Assistant.
Modification Type: | Major | Last Reviewed: | 6/23/2005 |
---|
Keywords: | kbbug kbpending KB191100 |
---|
|