Textbox And Label Inner Margins
Let it be a Form or Report, a good design will always catch the eye of the User and the onlooker alike. We all design them, but if we give the same Report or Form to five different people to design, they all will do it differently based on their individual skill and tastes, unless they all use the same built in wizards.
The user may give importance mainly to the information contained in a Report and insist only on getting it in the right order and layout. But, how to present this to him/her is your responsibility alone and depends on how much time you have to work on it. You will be designing a Report only once and it is part of your Project, how you do it is your own choice.
Your Report may also travel to places through Faxes or E-mails and likely to have a wider audience to it. Where-ever it goes I expect some one to ask who designed it when compared with other Reports floating around. Luckily, MS-Access has all the right Tools you need for designing strikingly beautiful Reports or Forms. Little more of your time and imagination can do wonders with simple tools available in Access.
Here, I would like to introduce you to few Properties of Text Boxes and Labels on a Report and how simple design changes can transform it into a nice looking Report. The following is an image of a Tabular Report designed with the Report Wizard of MS-Access.
Wizards are very good in laying out all the objects quickly on Forms or Reports with default formatting of Font Type, Size, Style and saves a fair amount of design time. All you need to do is to modify them to your liking.
If you would like to try out this simple design step by step then you may Import the Shippers Table from C:\Program Files\Microsoft Office\Office11\Samples\Northwind.mdb MS-Access sample Database. The location address shown here is for MS-Access2003. If your Version of Access is different then look for change in \Office11\ part of the address. After importing click on the Table and select Report from Insert menu and select Auto Report: Tabular from the displayed options. The above Report will be created in no time. An image of the above Report in Print Preview is given below:
The modified version of the same Report in Print Preview below:
The transformation was easy with only few changes to the above design and I know what change you have noticed first. If I have turned on the borders of the Text Boxes and Labels alone then the Print Preview will look like the one below:
Make the following changes to the above design:
- Delete the thick line under the Header Labels.
- Point the Mouse on the vertical ruler to the left of the Header Label Shippers, so that it turns into an Arrow pointing to the right, and then Click and drag along the ruler downwards so that you could select all the Labels and Text Boxes in the Report Header, Page Header and Detail Sections together.
Alternatively you can click on an empty area of the Report and drag the Mouse over all the controls to select them. Do not select the Page Footer Section Controls. We don’t need them on this Report.
- Display the Property Sheet (View- -> Properties) and change the following Values:
- Border Color = 9868950
- Special Effect = Flat
- Border Style = Solid
- Border Width = Hairline
You need to change only the Border Color Value, others will be there as default, if not then change them as given above.
- Select all the Field Header Labels alone in the Page Header Section, as we did in Step-2 above. Select Format- – > Align – -> Left to arrange the labels close together horizontally without leaving gaps between them.
- Display the Property Sheet of the selected Labels (View – -> Properties) and change the Top Property Value to 0 and Height Property Value to 0.4167"
- Centralize the Text horizontally within the Labels by changing the Text Align Property Value to Center, while all the Labels are still in selected state.
- Select all the Text Boxes in the Detail Section together and select Format- – > Align – -> Left to arrange the Text Boxes close together without leaving gaps between them.
- Display the Property Sheet of the Text Boxes (if you have already closed it) and change the Top Property Value to 0 and the Height Property Value to .2917" so that the data lines are not too close and crowded when Previewed/Printed.
- If there is gap below the Labels in the Page Header Section and below the Text Boxes in the Detail Section then close them by dragging up the Detail Section Header and the Page Footer Bars.
- Delete all the Page Footer Section controls. Close the gap by dragging the Report Footer Bar up.
- Now we must resize the Report Header Label with the Shippers heading and make it as wide as the width of all Field Header labels in the Page Header Section put together. You can either do it by resizing manually with your eyes as guide. Or display the Property Sheet of all the Header Labels one by one and take the Width Property Value of each label and add up to get the total of all and change the Width Property Value of the Shippers heading label.
- Change the Height Property Value to 0.416 and the Text Align Property Value to Center.
- Save your Report with a Name of your choice.
With the above modifications the Report will look like the image given below, when Print Previewed.
The Report looks good, but with few more cosmetic changes it will look even better.
- The Field Header Labels' Text must be vertically centered.
- The Shipper ID Numbers and other field values are too close to the Border Line and they should be positioned little away from the border.
- Open the Report in Design View and select all the Field Header Labels together as we did earlier.
- Display the Property Sheet and drag the right scroll bar of the Property Sheet down to the bottom. There you will find the Inner Margin Properties that you can use to position the Text within the Controls.
NB: These Properties are available only in MS-Access2000 and later versions.
- Change the Top Margin Property Value of Header Labels to 0.1?
- Select the Text Controls together on the Detail Section and change the Top Margin Property Value to 0.0701".
- Select the Shipper ID Text Box in the Detail Section and change the Right Margin value to 0.1?
- Select the Company Name Text Box and change the Left Margin Value to 0.0597? and set the same Left Margin Value for Phone Number also.
- Save your Report and open it in Print Preview. It will look like the 3rd Image from Top of this page.
Even though it took lengthy steps to explain it, you can do it quickly in a few minutes, when you know what to do to get what you want.