Tuesday, November 20, 2007

Understanding Access 2007 Layout Grouping


Here's a look in design mode at one of the new Access 2007 features - Stacked Layout. The highlighted controls are grouped together in a table-like structure in such a way that when you change the width of one control, the other controls in the same column change width as well. Same for controls in rows. This is a nice feature for helping to keep controls organized on a form.

But what if you want to manipulate these controls at runtime? Say change the size and/or position of these control? Like so (from a command button OnClick event procedure):

Text0.Left = Text0.Left + 100

You'll find that these controls are quite a different animal. First, moving one control will move ALL of the controls in the group - well, depending on which of the controls in the layout group you move, that is. In my experimentation, if you attempt to move any control in the right column, nothing happens. But moving the control in the upper left moves all the controls in the group.

But what if you change a font in one of the controls, does it change for all the controls in the layout group? No.

Weird. More on layout groups later.

No comments: