Microsoft KB Archive/191100

= ACC97: Hyperlink Is Not Displayed as Expected in Report Header =

Article ID: 191100

Article Last Modified on 1/23/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition

-



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#"



RESOLUTION
Microsoft 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.</li> On the View menu, click Design View.</li> On the View menu, click Sorting And Grouping.</li>  In the Sorting And Grouping dialog box, select SupplierID from the Field/Expression box, and set the following properties: <pre class="fixed_text">  Group Header: Yes </li> Add a text box to the SupplierID header section of the report, and set the following properties:

<pre class="fixed_text">Control Source: =IIf(IsNull([HomePage])=False,FParseHyperlink([HomePage])) Fore Color: 16711680 Font Underline: Yes

</li> On the File menu, click Save. Type Hyperlink-Format, and then click OK.</li> On the File menu, click Print Preview.</li></ol>

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.

<div class="status_section">

STATUS
Microsoft has confirmed this to be a problem in Microsoft Access 97

<div class="moreinformation_section">

Steps to Reproduce Problem
 Open the sample database Northwind.mdb.</li> 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.</li> On the View menu, click Design View.</li> On the View menu, click Sorting And Grouping.</li>  In the Sorting And Grouping dialog box, select SupplierID from the Field/Expression box, and set the following properties: <pre class="fixed_text">  Group Header: Yes </li> Drag the HomePage label and text box to the Supplier ID header section.</li> On the File menu, click Save. Type Hyperlink-NoFormat, and then click OK.</li> On the File menu, click Print Preview.</li></ol>

Note the number signs (#) surrounding the HomePage text boxes that have a value.

<div class="references_section">