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 , by default, a form displays its name. In reality, the string on the right side of the icon is called the caption of the form. The caption of a form is recognized by the Caption property. If you do not specify the caption, the title bar of a form displays its name.
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 that you can use to close the form.
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 , or , . Here is an example:
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.
Instead of completely hiding all system buttons of a form, you can specify which ones to display and thus control the ability to close, minimize, or maximize the form. The presence and/or the role of the system buttons is (partly) managed by the Control Box and the Min Max Buttons properties. When the Control Box property is set to No, regardless of the value of the Min Max Buttons property, there would be no system buttons on the title bar. If you want to control the appearance and behavior of the system buttons, the Control Box property must be set to Yes. The values of the Min Max Buttons produce the following results:
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 using the split form, if you click a record in the bottom section, its values display in the top section.
To automatically generate a split form, in the Navigation Pane, click
the table that holds the records. Then, on the Ribbon, click Create.
In the Forms section, click Split Form.
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 body. 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. The Detail bar displays only when the form is in Design View.
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. 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.
As much as you can, you should design your (non-Datasheet) form to display all of the fields of a record whenever the/a record comes up. Sometimes this will not be possible. If a form possesses too many fields for each record, Microsoft Access would equip the form with one or two scroll bars. A scroll bar allows the user to scroll from one side of the form to another. The vertical scroll bar is used to scroll up and down while the horizontal scroll bar allows scrolling left and right:
By default, scroll bars come up if the form "judges" them necessary, such as if some fields, or some area of some fields, are hidden. The presence of scroll bars allows the user to be aware of hidden fields. Depending on your design, you can control the appearance or disappearance of the scroll bars. To do this, change the values of the Scroll Bars field in the Format property page. There are four possible values. To display only the vertical scroll bar, set the value to Vertical Only:
In the same way, you can display only the horizontal scroll bar by selecting Horizontal Only. On the other hand, you can display both scroll bars by setting the value to Both. If for some reason you do not want any scroll bar, set the Scroll Bars property value to Neither.
A form is equipped with a special area that allows you to select a record. This area is called the Record Selector. The Record Selector is on the left side immediate to the left side of a record on the form. Its size depends on the type of record. For a regular form (Single Form), the record selector is the long vertical box on the left of all records:
On a datasheet form, a tabular form, or the datasheet section of a split form, the record selector is the box on the left side of each individual record. This means that the view of the form can display many record selectors, one for each record. In the following screenshot, the record selector of each record is the blue box on its left:
If you do not want a form to display the record selector(s), in its Design View, 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 if the form is displayed in a view other than the Design View.
If you do not 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 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, 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. 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 screenshot:
When you preview the form, it would appear with the expanded size, which is not the actual 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 pictures 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 do not have to worry about shipping it with the database. The disadvantage is that, (if you 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 positioned 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 positioned 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 did not 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 do not enjoy white forms, you can set the background to a color of your choice. Unlike the picture, the form (fortunately) does not 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 do not 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
A dialog box is a rectangular object that is used to host or carry other controls:
A dialog box is primarily characterized by two features: its title bar and its body. The title bar, on top of the dialog box, can have a title and has the system close button . Although this is the normal appearance of a dialog box, it is not strictly exclusive. Some dialog boxes display the system icon. On the right side of the title bar, a classic dialog box displays only the system Close button made of X. Again, this is not exclusive. It is not unusual for a dialog box to display the minimize and the maximize/restore buttons. To use a dialog box, the user must open it one way or another. Your job is to decide how and when the user will be able to open a dialog box.
There are various ways you can create a dialog box in Microsoft Office Access 2007:
There are two types of dialog boxes: modal and modeless.
A dialog box is characterized as modal if the user must close it before continuing with another task on the same application.
In order to use a dialog box in your application, you should analyze a scenario and define if the dialog box is necessary. Use a dialog box if you want the user to first terminate whatever task he or she would be performing. For example, if a user is performing a payment of an order processing, it is natural to process and finish that payment before starting another task.
A classic (or normal) dialog box would need neither a Record Selectors bar nor the record navigation buttons. Therefore, you should decide how the dialog box would be used. If you want a regular dialog box as those available on non-database applications, you should set the Record Selectors, the Navigation Buttons and the Dividing Lines properties to No each.
A dialog box is referred to as modeless if the user does not have to close it in order to continue using the application that owns the dialog box. The Find dialog box of most applications is an example of a modeless dialog box. If it is opened, the user does not have to close it in order to use the application or the document in the background.
Since the modeless dialog box does not display its button on the task bar, the user should know that the dialog box is opened. To make the presence of a modeless dialog box obvious to the user, it typically displays on top of its host application until the user closes it.
To create a modeless dialog box, or to convert a form into a modeless dialog box, in Design View, set the Popup property (Other and All tabs) to Yes. This makes sure that the user can work on another form and the modeless dialog box or form would remain on top of any other form of your database.
|Previous||Copyright © 2008-2012 FunctionX||Next|