CanGrow, CanShrink Properties

Applies To

Form Section, Report Section, Subform/Subreport Control, Text Box Control.

Description

You can use the CanGrow and CanShrink properties to control the appearance of sections on reports and controls on forms that are printed. For example, if you set both properties to Yes, a section or control automatically adjusts vertically to print or display all the data the report or form contains.

Note The CanGrow and CanShrink properties do not apply to form or report header and footer sections.

Setting

The CanGrow property uses the following settings.

Setting Description Visual Basic
Yes The section or control grows vertically so that Microsoft Access can print all the data it contains. True (-1)
No (Default) The section or control doesn’t grow. Data that can’t be seen won’t be printed. False (0)


The CanShrink property uses the following settings.

Setting Description Visual Basic
Yes The section or control shrinks vertically so that Microsoft Access can print the data it contains without leaving blank lines. True (-1)
No (Default) The section or control doesn’t shrink. False (0)


You can set these properties only in the property sheet.

For controls, you can set the default for these properties using the default control style.

These property settings are read-only in Visual Basic.

Remarks

If you set a control’s CanGrow property to Yes, Microsoft Access automatically sets the CanGrow property of the section containing the control to Yes.

Sections grow and shrink vertically across their entire width. However, report header and footer sections will not grow, even if the CanGrow property of a control is set to Yes.

When you use the CanGrow and CanShrink properties, remember that:

  • The property settings don’t affect the horizontal spacing between controls; they affect only the vertical space the controls themselves occupy.
  • Overlapping controls can’t grow or shrink.
  • The size of a large control can prevent controls beside it from shrinking. For example, if several small controls are on the left side of a report’s detail section and one large control, such as an unbound object frame, is on the right side, the controls on the left will not shrink, even if they contain no data.

See Also

Format Event, Retreat Event.