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

Make it Neat – Consistent Sizes and Spaces

 

Take a look at the picture below. The bottom curved figure looks larger than the top figure. In reality they’re the same size. If you don’t believe me, break a ruler and  and measure them.

This particular optical trick, called the Jastrow illusion, appears distorted because of our tendency to measure similar elements from a central location. For a more in-depth explanation of this effect as well as others, see http://www.thirdeyehealth.com/optical-illusions.html.
 
In Access, we typically want similar things to be the same size. We don’t want people using our database to become distracted when similar items have slightly different or inconsistent sizes. Instead we want people to tune in to the information contained in the data rather than some disconcerting design elements.
 
In Access, you can spend a lot of time adjusting  control sizes to get them to be the same. Last month, we talked about ways to get things to align easily. This month, I will show you how to get a series of elements all to the same size and neatly spaced.
 

The Problem

As you place form or report controls, they probably start out the same size, but as you adjust their size for their contents, you may find that you have, in some cases, a jumble of different sizes as you see below.



What we would really like to see is this:


 
To get them sized and aligned nicely, we use the Size/Space Tool.
 

The Size/Space Tool

This nifty tool, used while designing elements in forms and reports, helps make things organized and neatly arranged. When you are designing a form or report, you will see a group of tabs called Form Design Tools. One of the tabs in that group is called Size/Space, shown below.



The elements in this toolbar become available once you have selected more than one control on your form or report.
 
To use this tool take the follow steps: Select elements you want to be the same size, then click in the ribbon menu either To Widest, or To Narrowest. Now everything you selected will be a uniform width.  Follow the steps again to get them to the same height by choosing either tallest or shortest.
 
If there are a lot of elements, you might find that you have to go through several iterations because your preferred size may not be either the widest or narrowest. To deal with this limitation, you choose only those elements that are either wider or narrower than your preferred size, as well as the element which is your target size and the use the tool. After that, repeat the process selecting all elements and choosing To Narrowest.
 
For uniform spacing, apply the same procedure and just apply a different menu selection to make things uniform. The spacing menu also allows you to increase or decrease spacing, so you easily tweak away until you get the look you want.
 

Conclusion 

Using the approach I’ve shown you here will help you get away from trying to nudge controls to the right size and space. 
 

Tip of the Month: The WeekDay and WeekdayName Function


Every once in a while, you may want to determine the English equivalent of the day of the week for a particular date. You can always display the name of the weekday by using the formating, “ddd” or “dddd” which will return Mon or Monday, etc.  However, that is a display only item. The actual date is still stored in the control even if the user is seeing Mon or Monday.
 
To truly determine the English version of the day of the week, use the weekday function. This function takes three parameters (only the first is required) and will return a word for the day of the week; Mon, Monday, Tue, Tuesday, etc. The first parameter is the day of the week (a number from 1 to 7 or alternately vbSunday, vbMonday etc. The second parameter controls the output, “Mon” vs “Monday”. The last parameter indicates which day 1 equals.  If you are in the United States, and have not changed the date defaults in Office, Day 1 represents Sunday.
 
So if you have a date and need to use the word for the day of the week you combine these two functions as follows:
 
WeekdayName(Weekday(#4/26/2014#))
 
This will return the word “Saturday”, which you can then then manipulate to use in your application.


 

Quick Links:

Custom Software Home

Access Wizard Archives

Our Services

email: jim@custom-software.biz
phone: 978-392-3462
web: http://www.custom-software.biz
© Copyright Custom Software
All Rights Reserved | Westford, MA 01886