The Access Wizard Newsletter
Tips, Tricks, and Traps for Access Users and Developers.

Easy Ways to Arrange Controls – Do it as a Group

 

Have you ever tried to herd a group of cats? It is a tough job; they have no interest in cooperating and moving nicely together. You end up having to move them one by one and, even after you have them where you want, they immediately start to wander around. In a similar way, when you have several controls on a form or a report, you can move them one by one to line up nicely, but this can be a tedious task.

In this month’s Wizard, I will show you how to make the process of getting form controls placed neatly and easily with just a couple of tools. Note that the directions here work with both forms and reports.  For the sake of simplicity, I’ll be talking about forms, but know that it also applies to reports.
 

Aligning Things with the Grid

The grid is a series of dots that you see when you open a form or report in design mode. The purpose of the grid is to help you get things lined up nicely. As you place controls on a form, by default, they “snap” to the nearest grid marks. Out of the box, the grid is fairly tightly spaced, which may limit its use to you.
 
To change the grid spacing, do the following:
  • Open your form in design mode.
  • Select the entire form by clicking the little square in the upper left hand corner of the form.
  • Click on the format tab and scroll down until you see the Grid X, Grid Y properties.


Unless you have already changed these options, they will both read 24. The 24 indicates the number of dots per inch. As you change these numbers, the dots in the grid will become more or less dense. Experiment to find which one most closely fits your needs.
 
The other important element of getting controls aligned with the grid is to make sure that you have snap to grid turned on. In 2007 and above, you will find this on the Ribbon arrange tab, in the sizing and ordering group under the size/space menu.
 

Aligning Controls Using Tools

If you have never used the align tool in Access, you will wish you discovered this when you first started using the program. The align tool can be found under the Arrange menu in the Sizing & Ordering group.



These elements become active if you have selected more than a single control. I find that I use these frequently when I’m in design mode.
 
For these tools to be available, you have to have at least two controls selected, but you can have as many as you would like. To select more than a single item, hold down the shift or control key as you click on each element in turn. Once you have the ones that you want selected, choose to the left, right, top, or bottom and they will line up with the ease of a mouse click.
 

Conclusion and a Look Ahead

This month, I showed you how to select controls and align form elements using the grid and the align tools on the Ribbon. With these tools, getting things lined up and looking pretty is a whole lot easier.
 
Next month we'll take another step to making life easier when placing controls: We’ll review a tool that will help you to get consistent positions and sizes in your forms.
 

Tip of the Month: Use the Ruler to Select Elements


I touched on this form element management back in February 2011.  In that article, I also showed a very easy way to select several controls using the ruler. Check out this link for a fast way to select a group of elements with a single mouse click.

 

Quick Links:

Custom Software Home

Access Wizard Archives

Our Services

© Copyright Custom Software
All Rights Reserved | Westford, MA 01886