This property is on form and report sections and many controls like Text Boxes. This seems to be a wonderful property for automatically adjusting the height of things on a form until you make the inevitable discovery:
It only works in a form when you are printing the form, not when it is displayed on the screen.
It does work very well on reports and the element will automatically grow in height to accomodate the content of the controls in both print preview and report view modes.
It even works well on subreport controls which you can place on forms.
This can be quite helpful, but it does have some limitations without invoking some pretty hefty windows API routines in a very specific situation.
When you are using the CanGrow Property in a sub-report displayed on a form, you cannot calculate the actual size of the sections as they grow, and the actual report height will give you design view heights rather than actual heights being displayed. It seems that the only way around this would be to calculate each potential control’s height based on some API functions to get the height and width of the text for that row.
Although perhaps another way to find this would be to actually open the report in print preview mode, place the total height in a control that you read into a global variable, then close the report and re-load it in the subreport control. I’m sure that could work if you display the report to the user, not sure if it would work behind the scenes with Application.Echo turned off. It depends on whether the OnPrint event would fire.
Since this is something I need to get working, I’ll let you know what I end up doing to get around this little quirk.