ACC97: Using AutoFormat Changes Appearance of Hyperlinks

Last reviewed: October 16, 1997
Article ID: Q175219
The information in this article applies to:
  • Microsoft Access 97

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

When you use the AutoFormat feature on a form that contains a hyperlink, the default color for the hyperlink text is changed.

CAUSE

By default, the hyperlink color will be what is specified in the Followed Hyperlink Color or Hyperlink Color box on the Hyperlinks/HTML tab of the Options dialog box. However, because the hyperlink control is considered a label, it uses the default color specified for labels in the format selected with the AutoFormat feature.

RESOLUTION

You can use either of two methods to set the color for the hyperlink text:

  • You can set the color for the hyperlink text by using the ForeColor property for the control.

        -or-
    
  • You can specify the color of the hyperlink text by using code.

Setting the Color for the Hyperlink by Using the ForeColor Property

  1. Using the right mouse button (right-click), click the hyperlink control, and then select Properties.

  2. In the Properties dialog box, click the Format tab. Scroll down to ForeColor, and select the color you want.

Setting the Color for the Hyperlink by Using Visual Basic Code

  1. Open the form in Design view.

  2. On the Edit menu, click Select Form.

  3. On the View menu, click Properties.

  4. In the Form dialog box, click the Event tab, and then click in the OnCurrent box.

  5. Click the ellipse to the right of the OnCurrent box. In the Choose Builder dialog box, select Code Builder, and then click OK.

  6. To set the color for the text, type or paste the following sample line of code into the Sub procedure:

          Me!HyperLinkControlName.ForeColor = 255
    

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Start Microsoft Access and open the sample database Northwind.mdb.

  2. Open the Customers form in Design view.

  3. Place the pointer in the Form Header. On the Insert menu, click Hyperlink. The Insert Hyperlink dialog box appears. In the "Link to file or URL:" list box, type "http://www.microsoft.com" (without the quotation marks), and then click OK.

  4. Click the Form Header section again to move the focus from the hyperlink text. On the Format menu, click AutoFormat. In the AutoFormat dialog box, under Form AutoFormats, select Standard, and then click OK. The link now appears in black.

  5. On the Format menu, click AutoFormat again. This time select Dusk, and then click OK. The link now appears in yellow.

REFERENCES

For more information about the ForeColor property, search the Help Index for "ForeColor Property," or ask the Microsoft Access 97 Office Assistant.


Additional query words: prb
Keywords : IntLink
Version : WINDOWS:97
Platform : WINDOWS
Hardware : x86
Issue type : kbprb
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 16, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.