applied tips : may 2009

microsoft access : automatically resizing forms

With Access 2007, Microsoft introduced a new feature that allows forms to automatically resize themselves on larger monitors. This feature finally lets Access designers take advantage of larger displays while staying compatible with smaller ones.

Consider the two screen captures below:

 

 

Both of these are the same exact form, but displayed on different monitors. You'll see that the second form, with a larger screen, takes advantage of that screen by making the Notes field far larger.

Resizing forms automatically don't have to just be for giant Notes fields.  They were great for continuous subforms that can show more rows of data on larger displays.

Understanding Automatic Resizing (Anchoring)

This new feature is technically called Anchoring, and basically you're telling Access that for any selected Control on the form (a text box, list box, sub form, even line) you want it to "anchor" the corners of the control relative to the size of the form.

So, a Notes field like above with Anchoring set to "Stretch Down and Across" will do just that. The lower-right corner of the Notes field will grow with the form, using up all available space down and across.

Enabling Anchoring

Select an object, and from the Form Design Tools - Arrange tab in the Ribbon, look for the Anchoring pull-down gallery.

Anchoring

Choose any of the eight options to apply that style of anchoring to your selected object. Here's what they do:

Troubleshooting

The distance that a control will stretch, and how far it will move, is based relative to where it is located while in design mode. This can create some unusual effects but gives you more flexibility.

For example, take a look at this form in design mode:

 

You'll notice that the form has about 1" of unused space on the far right. If we select the Notes field and set it to "Stretch Down and Right", it will leave a 1" gap on the far right of the form no matter what size the window is. This is because we've designed it that way. If we adjust the width of the form so that the gap is removed, "Stretch Down and Right" will go all the way to the bottom and right.

Once you dig into the Anchoring feature, it's easy to lose track of what you've configured and have some poorly-behaving forms

If things get out of hand, simply select all of your controls and reset them to "Top Left". Then, one at a time, adjust their anchoring style until you reach the desired effect.

schedule a class or get consulting on access

Request an on-site Access class from Applied Office or get some helpful consulting. Learn more here

upcoming classes in Stockton, CA

Applied Office is offering hands-on classes in June and July in Stockton, CA starting at just $45, or $185 for a full day!  Learn more here