Table of contents
Collapse the table of content
Expand the table of content

OptionGroup.DisplayWhen Property (Access)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

You can use the DisplayWhen property to specify which of a form's controls you want displayed on screen and in print. Read/write Byte.


expression. DisplayWhen

expression A variable that represents an OptionGroup object.


The DisplayWhen property applies only to the following form sections: detail, form header, and form footer. It also applies to all controls (except page breaks) on a form.

The DisplayWhen property uses the following settings.

SettingVisual BasicDescription
Always0(Default) The object appears in Form view and when printed.
Print Only1The object is hidden in Form view but appears when printed.
Screen Only2The object appears in Form view but not when printed.

For controls, you can set the default for this property by using the default control style or the DefaultControl property in Visual Basic.

In many cases, certain controls are useful only in Form view. To prevent Microsoft Access from printing these controls, you can set their DisplayWhen property to Screen Only. For example, you might have a command button or instructions on a form that you don't want printed. Or you might have form header and form footer sections that you don't want displayed on screen but that you do want printed. In this case, you should set the DisplayWhen property to Print Only.

For reports, use the Format and Retreat events to specify an event procedure or macro that sets the Visible property of controls you don't want printed. You can also cancel the Format or Print event for a report section to prevent the section from being printed.

See also


OptionGroup Object

© 2018 Microsoft