![]() |
The Characteristics of a Form |
|
Anatomy of a Form |
Remember that, when displaying data to a user, the form shows in Form View, if you are designing, or modifying the design of, a form, you must display it in Design View. In some case, whether in Form View or in Design View, a form is
represented by a tab that displays an icon |
On the right side of its icon To specify the caption of a form, access its Properties window and, in the Format or the All tab, click Caption and type the desired string.
We mentioned that a form was represented in its top section
by a tab. When a form displays with a tab, the right section of the
tab(s) displays a close button If you want, you can replace the tab of a form and let the form display without the tab. To do this, click the Office Button and click Access Options. In the left frame of the Access Options dialog box, click Current Database. In the right frame and in the Document Window Options section, click the Tabbed Documents radio button and remove the check mark on the Display Document Tabs check box, then click OK. On the message box that appears, click OK. Close and reopen the database. By default, a form displays with a tab, in which case the user cannot move it. Otherwise, a form can appear as a regular window with its system buttons. To take care of this, you can click the Office Button and click Access Options. In the left frame, you can click Current Database and, in the right frame, in the Document Window Options sections, click the Overlapping Windows radio button:
After making the selection, you can click OK. You will be asked to close and reopen the database:
Which you should do. If you display a form as overlapped, it would be equipped
with
three system buttons
The
group of these buttons is called the Control Box. If you do not
want these system buttons at all, access the Properties window of the form
and set the Control Box Boolean property to No from its Yes
default value. In this case, the form would appear with neither the system
icon nor the system buttons. If you do this,
make sure the user has a way to close the form.
Depending on the role and probably the number of Windows controls on a form, you will decide what button to allow or not.
Whether you allow the system icon and system buttons or not, the user needs to be able to know where a form starts and where it ends. This is seen by the borders of the form. In most cases, you will not be concerned with this aspect. Otherwise, you can control the borders of a form. The borders of a form are controlled using the Border Style property. If you set it to None, the form would appear without borders.
The main area of the form is what the user will mostly use. This is also referred to as the body of the form. If you create a form using the Form Wizard, it (the wizard) can assist you with deciding how the objects in the body of the form would display. Forms can be designed in various flavors: Columnar, Datasheet, Tabular, Justified:
When it comes up, a form is presented as a rectangular box. A form in Design View is made of a form selection button, two rulers, two scroll bars, a horizontal bar labeled Detail, and a gray area. By default, a form presents a section referred to as the Detail section. This section starts from the Detail bar to the lower end of the section. Besides the Detail section, a form can be equipped with a section on top and another section in its bottom part. To add these sections, you can:
Any of these two actions would add two new sections to the form: the Form Header section on top and the Form Footer section at the bottom:
Although two sections are added, you can reduce one completely so it would not appear to the user. This means that you can keep one section and hide the other. If you create a form using the Form Wizard, both the header and the footer sections are added but the footer section is completely reduced so it would not appear to the user. If you want to display it to the user, you must expand it.
A form can also be equipped with two other sections. To get them, you can:
Any of these actions would add two new sections to the form: a Page Header and a Form Header sections. These sections would not appear to the user. They appear only if the user decides to print a form, in which case they would appear on the printed paper. Like the Form sections, you can use either one or both the Page Header and the Page Footer sections
A form is equipped with special horizontal lines used to visually separate sections of a form. They do not perform any other special action. To equip a form with dividing lines, add a header and a footer sections. On the other hand, if you create a form that is directly equipped with a header and a footer sections, it would display the dividing lines. The presence or absence of the horizontal lines is controlled by the Boolean Dividing Lines property. If you set its value to Yes, the dividing horizontal lines would display on the form. To hide both lines, you can set this properties value to No. To hide an individual line, you can completely reduce its section.
A form is equipped with a special area that allows selecting the currently displaying record. The Record Selector is on the left side immediate to the left border of the form. By default, the record selector area is available on all forms. If you create a Columnar or a Justified form, the body of the form would display only one record selector and on its left side. If you create a Tabular or a Datasheet form, each record would display its own record selector on the left side. This means that the view of the form can display many record selectors, one for each record. If you don't want a form to display the record selector(s), set its Record Selectors property to No.
In the bottom section, a form is equipped with the same navigation buttons used on tables. These buttons are useful only if the form is meant to display data. The buttons are available only if the form is displayed in Form View. If you don't want a form to display the navigation buttons, set its Navigation Buttons property to No.
By default, a form is equipped with a status bar or navigation bar. On the left side of the bar, it displays the Record: label. If you want, you can change that string to a short one of your choice. To change the text on the left side of the navigation bar, in the Properties window of the form, click the Format tab and, in the Navigation Caption field, enter a string of your choice. Here is an example of a result (notice the Navigation string on the lower-left side of the bottom bar):
The width of a form is the distance from its left border to its right border. The width of a form is the common width of each one of its sections. All sections use the same width. To widen or narrow a form, position the mouse on the right border of one of its sections. The mouse cursor would turn into a vertical line with a horizontal double arrow:
You can then click and drag right to widen or left to narrow the form. The width of a form is a numeric value. To change its value with a little more precision, access the Properties window of the form. In either the Format or the All tab, click the Width field, type a decimal value and press Enter.
The height of a form is controlled by its sections. For this reason, each section controls its own height. The total heights of all sections constitute the height of the form. Based on this, to resize a form, you must actually resize one or some of its sections. To heighten a section on a form or a report, position the mouse on the lower portion of the section. For the headers or the Detail sections, that will be the upper border of the lower bar. For the lowest section, the mouse must be positioned on the lower border. The cursor turns into a narrow horizontal line with a vertical double-arrow:
The height is a numeric value. As mentioned already, each section of a form controls its own height. Based on this, to numerically change the height of a section of a form, access the Properties window of that section (to do this, you can double-click the section). In either the Format or the All tab, click the Height field, type a decimal value and press Enter. This also means that, to set the total height of a form, you can change the Height value of each section.
To change both the width and the height of a form at the same time, you can position the mouse on the lower-right corner. The cursor would change into a small square with 4 arrows:
You can then click and drag left, right, up, down, or diagonally. To numerically change the width and the height of a form, change the value of the Width of the form. Then change the Height values of the individual sections.
When you open a form from the Navigation Pane, the object is positioned from the top-left corner of the gray area of Microsoft Access. If you want the form to be automatically centered, access its Properties window and, in the Format or the All tab, set its Auto Center Boolean property to Yes from its default No value.
While designing a form, you may stretch its right and/or its bottom borders beyond the actual borders of the form. Consider the following:
When you preview the form, it would appear with the expanded size, which is not the real size of the form. The above form would produce:
When the form is previewed, to get its actual size, on the
ribbon, click Home. In the Window section, click the Size To Fit Form
Except when we used the Form Wizard, all of the forms we had created so far had a white background. If you want, you can cover a form with a picture. Microsoft Access provides a few but you can also use a picture of your own. To use a picture as a background, after accessing the properties of the form, in the Format or the All tab, you can click Picture and click its browse button. This would open the Insert Picture dialog box that allows you to locate and select a picture. Microsoft Access supports all the popular picture formats, including BMP, JPEG, GIF, and PNG. After selecting the picture, you can click OK. Because the Picture property (unfortunately) belongs to the form and not to one of its sections, the picture you use would cover all sections of the form. Obviously before using a picture, you should design or be very familiar with it. This is because you may want one sample of the picture to cover the whole form. Here is an example:
This would produce:
After adding a picture to a form as its background, by default, the picture becomes part of the database. This is referred to as embedding the picture. The advantage is that, if/when you distribute the database, the picture would be added also and you don't have to worry about shipping it with the database. The disadvantage is that, (if you use add many pictures like that) the database file gets larger and larger. Microsoft Access provides an option. Instead of embedding the picture, you can provide a link to it so that, whenever the form is opened, it would connect to the location of the picture and show it. The advantage is that, because only a link is provided, which is simple text, the database cannot grow because of the picture. The disadvantage is that, if/when you distribute your database, you must remember to also (separately) ship the picture and you must make sure the form can find the picture every time it is opened. The embedding or linking characteristic is controlled by the Picture Type enumerated property whose two values are Embedded (the default) and Linked:
In some cases, you may want to use a picture smaller than the form. Here is an example:
If you use a picture that is smaller than the form, by default, the picture would be positionned in the middle of the form. This characteristic is controlled by the Boolean Picture Alignment property whose default value is Center. If you want the smaller picture to be positionned in one of the sections, select another value from this property. If you select:
If you want to use a picture smaller than the form but have it repeat itself on the form, this characteristic is referred to as tiling. To make this happen, in the Format or the All tab of the Properties window, set the Picture Tiling Boolean property to Yes. Consider the following example:
If you set the Picture Tiling property to Yes, this would produce:
If you didn't pay attention when designing the picture or if you got it from somebody, after specifying it as the background of the form, you may find out that either it is too narrow, too wide, too short, or too tall for the form. There are various ways you can manage this situation. One of the options you have is to control the size mode through the Picture Size Mode property. Consider the following example:
Picture Size Mode is an enumerated property whose values are:
In all forms we have created so far, unless using the Form Wizard or occupying it with a picture, the body of the form was painted with a white color. If you don't enjoy white forms, you can set the background to a color of your choice. Unlike the picture, the form (fortunately) doesn't control its background color. This aspect is left to each section to manage. Before specifying the color of a form, first click or select the intended section. To change the background color of a section:
Unlike the Fill/Back Color (and the Font Color) of the Font sections of the Home and the Design categories of the ribbon, when you right-click a section of a form and position the mouse on Fill/Back Color, the colors that display don't show their tool tip, which would indicate their names. Because the layout of colors is the same as the Fill/Back Color and the Font Color windows of the Font sections of the Home and the Design categories of he ribbon, we will use their names.
Microsoft Access provides some special visual effects used to raise or sink, etc a section of a form or report, a label or a field. These effects can be controlled by using the Special Effect field in the Properties window.
We saw that, when you create a form using the Form Wizard, you have the option of applying one of the designs provided by Microsoft Access. If you create a form in Design View, you would have the regular design. You can still apply one of the designs supplied by Microsoft Access. To use one of the pre-designs available in Microsoft Access
If you design a good looking form and want to use its design in other databases, you can add it to the list of designs of the AutoFormat window. To do that:
In the Customize AutoFormat dialog box, you can click the Create A New AutoFormat Based radio button and click OK
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||
| Previous | Copyright © 2007, yevol.com | Next |
|
|
||