FontUnderline Property

Microsoft Access Visual Basic

FontUnderline Property

       

You can use the FontUnderline properties to specify whether text is underlined in the following situations:

Read/write Boolean for the following objects: ComboBox, CommandButton, FormatCondition, Label, ListBox, TabControl, TextBox, and ToggleButton. Read/write Integer for the Report object.

expression.FontUnderline

expression   Required. An expression that returns one of the above objects. 

Remarks

The FontUnderline property uses the following settings.

Setting Visual Basic Description
Yes True (-1) The text is underlined.
No False (0) (Default) The text isn't underlined.

For controls on forms and reports, you can set this property by using the control's property sheet, a macro, or Visual Basic.

For reports, you can use this property only in an event procedure or in a macro specified by the OnPrint event property setting.

You can also set this property by clicking Underline on the Formatting (Form/Report) toolbar.

You can set the default for this property by using the default control style or the DefaultControl method in Visual Basic.

For a text box, combo box, label, or command button that contains a hyperlink, Microsoft Access automatically sets the FontUnderline property to Yes if the Underline Hyperlinks box is checked on the Hyperlinks/HTML tab of the Options dialog box, available by clicking Options on the Tools menu. If you remove the hyperlink from the control (for example, by changing the ControlSource property of a bound text box to a source that isn't a Hyperlink field), Microsoft Access sets the FontUnderline property back to the default control style. For command buttons, the FontUnderline property setting takes effect only if the command button contains a caption rather than a picture.