Learn Microsoft Access Advanced Programming Techniques, Tips and Tricks.

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 skills 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 is likely to have a wider audience for it. Where-ever it goes, I expect someone 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.

Precision Positioning of Data

Here, I would like to introduce you to a few Properties of TextBoxes 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 or MS-Access.

Wizards are very good at laying out all the objects quickly on Forms or Reports with default formatting of Font Type, Size, and Style and save a fair amount of design time. All you need to do is to modify them to your liking.

A Sample Project.

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 the change in \Office11\ part of the address. After importing, click on the Table and select Report from the 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 a few changes to the above design and I know what change you have noticed first. If I have turned on the borders of the TextBoxes and Labels alone, then the Print Preview will look like the one below:

Make the following changes to the above design:

  1. Delete the thick line under the Header Labels.

  2. 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 in this Report.

  3. 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.

  4. 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.

  5. 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"

    Centralizing Text Vertically.

  6. Centralize the Text horizontally within the Labels by changing the Text Align Property Value to Center, while all the Labels are still in the selected state.

  7. Select all the TextBoxes in the Detail Section together and select Format- - > Align - -> Left to arrange the TextBoxes close together without leaving gaps between them.

  8. Display the Property Sheet of the TextBoxes (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.

  9. If there is a gap below the Labels in the Page Header Section and below the TextBoxes in the Detail Section then close them by dragging up the Detail Section Header and the Page Footer Bars.

  10. Delete all the Page Footer Section controls. Close the gap by dragging the Report Footer Bar up.

  11. 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 a guide. Or display the Property Sheet of all the Header Labels one by one and takes the Width Property Value of each label and add it up to get the total of all and change the Width Property Value of the Shippers heading label.

  12. Change the Height Property Value to 0.416 and the Text Align Property Value to the Center.

  13. Save your Report with a Name of your choice.

    With the above modifications, the Report will look like the image given below in  Print Preview.

The Report looks good, but with a few more cosmetic changes it will look even better.

  1. The Field Header Labels' Text must be vertically centered.

  2. The Shipper ID Numbers and other field values are too close to the Border Line and they should be positioned a little away from the border.

  3. Open the Report in Design View and select all the Field Header Labels together as we did earlier.

  4. 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.

  5. Change the Top Margin Property Value, of Header Labels to 0.1".

  6. Select the Text Controls together on the Detail Section and change the Top Margin Property Value to 0.0701".

  7. Select the Shipper ID, TextBox in the Detail Section, and change the Right Margin value to 0.1".

  8. Select the Company Name TextBox, and change the Left Margin Value to 0.0597" and set the same value for Phone Number also.

  9. Save your Report and open it in Print Preview. It will look like the 3rd Image from the top of this page.

Even though it took some long steps to explain it, you can do it quickly in minutes, when you know what to do, to get what you want.


1 comment:

  1. Nice fill someone in on and this post helped me alot in my college assignement. Thanks you on your information.


Comments subject to moderation before publishing.




Post Feed


Popular Posts

Blog Archive

Powered by Blogger.


Forms Functions How Tos MS-Access Security Reports msaccess forms Animations msaccess animation Utilities msaccess controls Access and Internet MS-Access Scurity MS-Access and Internet Class Module External Links Queries Array msaccess reports Accesstips WithEvents msaccess tips Downloads Objects Menus and Toolbars Collection Object MsaccessLinks Process Controls Art Work Property msaccess How Tos Combo Boxes Dictionary Object ListView Control Query VBA msaccessQuery Calculation Event Graph Charts ImageList Control List Boxes TreeView Control Command Buttons Controls Data Emails and Alerts Form Custom Functions Custom Wizards DOS Commands Data Type Key Object Reference ms-access functions msaccess functions msaccess graphs msaccess reporttricks Command Button Report msaccess menus msaccessprocess security advanced Access Security Add Auto-Number Field Type Form Instances ImageList Item Macros Menus Nodes RaiseEvent Recordset Top Values Variables Wrapper Classes msaccess email progressmeter Access2007 Copy Excel Export Expression Fields Join Methods Microsoft Numbering System Records Security Split SubForm Table Tables Time Difference Utility WScript Workgroup database function msaccess wizards tutorial Access Emails and Alerts Access Fields Access How Tos Access Mail Merge Access2003 Accounting Year Action Animation Attachment Binary Numbers Bookmarks Budgeting ChDir Color Palette Common Controls Conditional Formatting Data Filtering Database Records Defining Pages Desktop Shortcuts Diagram Disk Dynamic Lookup Error Handler External Filter Formatting Groups Hexadecimal Numbers Import Labels List Logo Macro Mail Merge Main Form Memo Message Box Monitoring Octal Numbers Operating System Paste Primary-Key Product Rank Reading Remove Rich Text Sequence SetFocus Summary Tab-Page Union Query User Users Water-Mark Word automatically commands hyperlinks iSeries Date iif ms-access msaccess msaccess alerts pdf files reference restore switch text toolbar updating upload vba code