$Account.OrganizationName
The Access Wizard Newsletter Tips, Tricks, and Traps for Access Users and Developers
February 2011

The Lazy Developer's Approach to Speeding Form Creation: Treat Controls as a Group

What would you rather do? (1) Spend four hours developing a database form or (2) Spend one-hour developing a database form and three hours enjoying your favorite activity?

This is a no contest question, unless you love, love, love to create forms. It is much better to be efficient and productive than just being productive. In this month's Wizard, I will show you how to up your efficiency quota by treating multiple controls as a group.

In this Issue
  • Tip of the Month - Adding Multiple Controls Quickly
  • The Design View: Plain Vanilla Selection
  • Selection with the Ruler
  • Speeding the Formatting Process

  • The Design View: Plain Vanilla Selection

    Below is a picture of a form that we will use for our example. Note that I created this particular form in Access 2010; the interface for earlier Access versions is slightly different, but the concepts are the same.

    You probably know that you can select a control by clicking on it in the toolbox. You may not know that you can select additional controls by holding down the shift key or control key while clicking to select several. It is also possible to lasso several controls by left-clicking on the form and, while holding down the left mouse button, surround (or lasso if you like pretending to be a cowboy) several controls. Once you have several controls selected, you can then move them, format them, and set defaults for them as a group.


    Selection with the Ruler

    Most people don't know that that there is another very powerful way to select groups of controls. Notice in the forms above and below, that there is a ruler along the top as well as along the side. You may have used the ruler to position controls with some precision or to get a sense as to the size of the form as a whole. The hidden select feature is that, if you click in the top or the side ruler, everything that is in line with your pointer when you click (vertically from the top, horizontally from the side) will be selected.

    For instance, in the picture below, I've moved my mouse into the left side ruler and clicked just below the detail bar.

    When Access sees that I am in the ruler, the mouse cursor changes to the black arrow. When I then click with the black arrow, all the controls that were in the same horizontal position as my arrow are selected. I can then go ahead and move things around or format them as a group.

    Going vertically accomplishes exactly the same thing. After you have selected a group of controls like this, you may want to selectively deselect one or more. To do this, hold down your control key and click on the control you want to deselect.


    Speeding the Formatting Process

    Once you have a group of controls selected, in addition to just moving them as a group, there are some controls that allow you to improve the appearance of your form very quickly. If you are using 2007 or 2010, on the Ribbon choose Form Design Tools | Arrange (for 2003 and earlier versions, choose menu | item format | align) and you will get the controls below:

    If you are working with a group horizontally, you can align the tops or the bottoms in one easy step. If you working vertically, you can align the controls left or right. Note that you can also use the size/space control to the left of the align control. This will allow you to get even spacing, or increased or decreased spacing. Your best bet to learn more is to select a group of controls and play with various menu items. The power available to speed development at this point is truly impressive. Using this approach, you can spend less time in the mechanics of control placement and more time creating a user-friendly design, or in other interesting activities.


    Tip of the Month - Adding Multiple Controls Quickly

    Frequently, when you are designing a form, you will be adding the same type of control, one after the other. You can of course open the toolbox click the control, click the form, click the control, click the form, etc. However, there is a much easier way to put multiple controls onto the form.

    If you are using 2007 or later, right click on your control and you will see the option to drop multiple controls. From there, click on your form wherever you want to control to land, then move your mouse to where you want the next control to be and click again. Continue this process until you place the control as many times as you like, then click on the control in the toolbox to stop the multi drop.

    If you're using 2003 or an earlier version, you can also do this by double clicking on the control in the toolbox to achieve the same effect.

    Using this technique, you will find that you can go much faster with the design and, once again, get to your favorite activity sooner.

    Quick Links...

    Custom Software Home

    Access Wizard Archives

    Our Services



    Join our mailing list!

    Forward email

    This email was sent to jim@custom-software.biz by jim@custom-software.biz |  

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