ACC97: Hyperlink Is Not Displayed as Expected in Report Header (191100)



The information in this article applies to:

  • Microsoft Access 97

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.
  1. Open the sample database Northwind.mdb.
  2. Create a module and type the following line in the Declarations section:
    Option Explicit
    					
  3. 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
    					
  4. On the File menu, click Save. Type HyperlinkFunction, and then click OK.
To test this function, follow these steps:
  1. 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.
  2. On the View menu, click Design View.
  3. On the View menu, click Sorting And Grouping.
  4. In the Sorting And Grouping dialog box, select SupplierID from the Field/Expression box, and set the following properties:
       Group Header: Yes
    					
  5. 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
    						

  6. On the File menu, click Save. Type Hyperlink-Format, and then click OK.
  7. 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

MORE INFORMATION

Steps to Reproduce Problem

  1. Open the sample database Northwind.mdb.
  2. 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.
  3. On the View menu, click Design View.
  4. On the View menu, click Sorting And Grouping.
  5. In the Sorting And Grouping dialog box, select SupplierID from the Field/Expression box, and set the following properties:
       Group Header: Yes
    					
  6. Drag the HomePage label and text box to the Supplier ID header section.
  7. On the File menu, click Save. Type Hyperlink-NoFormat, and then click OK.
  8. On the File menu, click Print Preview.
Note the number signs (#) surrounding the HomePage text boxes that have a value.

REFERENCES

For more information about creating hyperlinks, search the Help Index for "hyperlink fields," or ask the Office Assistant.

Modification Type:MajorLast Reviewed:6/23/2005
Keywords:kbbug kbpending KB191100