The Characteristics of a Form
Anatomy of a Form
The Object's Tab
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.
Practical Learning:Introducing Forms and Reports' Properties
1. Start Microsoft Access and open theHotel Management1database you started in the previous lesson
2. To create a new form, on the ribbon, click Create and, in the Forms section, click Blank Form
3. To save the new form, right-click the Form1 tab and click Save
4. Set the name toCentraland press Enter
5. To switch the form to Design View, on the right side of the status bar, click the Design View button
6. To access the properties of the form, double-click the button at the intersection of the rulers
The Caption of a Form
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 theCaptionproperty. 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, clickCaptionand type the desired string.
Practical Learning:Specifying the Caption of a Form
1. In the Properties window of the form, click the Format tab and click Caption
2. TypeMain Switchboardand press Enter
3. To save the form, press Ctrl + S
Tabbed Documents or Overlapped Windows?
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 buttonthat 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.
The Control Box
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 theControl Box. If you do not want these system buttons at all, access the Properties window of the form and set theControl BoxBoolean property toNofrom itsYesdefault 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.
The Min/Max Buttons
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 theControl Boxand theMin Max Buttonsproperties. When theControl Boxproperty is set toNo, regardless of the value of theMin Max Buttonsproperty, there would be no system buttons on the title bar. If you want to control the appearance and behavior of the system buttons, theControl Boxproperty must be set toYes. The values of theMin Max Buttonsproduce the following results:
Min Max Buttons / Result / System Buttons / Consequence
Minimize / Maximize / Close
None / Hidden / Hidden / Available / The form can only be closed
Min Enabled / Enabled / Disabled / Available / The form can be minimized or closed but not maximized
Max Enabled / Disabled / Enabled / Available / The form cannot be minimized but can be maximized
Both Enabled / Enabled / Enabled / Available / All operations (minimize, maximize, restore, and close) are allowed
Depending on the role and probably the number of Windows controls on a form, you will decide what button to allow or not.
Practical Learning:Accessing the System Buttons of a Form
1. Click the Office Button and click Access Options
2. In the left frame, click Current Database
3. In the right frame, in the Document Window Options, click the Overlapping Windows radio button
4. Click OK
5. On the Microsoft Office Access message box, click OK
6. Close Microsoft Access
7. Restart Microsoft Access and re-open the Hotel Management1 database
8. To reopen the Central form, in the Navigation Pane, right-click Central and click Design View
The Form’s Borders
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 theBorder Styleproperty. If you set it toNone, the form would appear without borders.
Form Layout
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:
· A columnar form is used to display data one record at a time. This is a convenient display for data entry and analysis because the user is able to examine each piece of information for each one record:
· A tabular form displays its data in a series of cells following continuous sets of records. All or almost all records are displaying in a single layout:
To create a tabular form, use the Form Wizard and select its option. Otherwise, you can design a from from scratch. Then, in the Format or the All tabs of the Properties window, set itsDefault ViewtoContinuous Form
· A Datasheet form looks and behaves like a table, displaying all possible records at the same time instead of one record at a time. A datasheet form is mainly used in relationships to display another table's related records. It is also suitable for people who prefer to work in a spreadsheet environment. This display allows the database developer to provide a sheet view to the data entry personnel without making the table's design or formats available.
You can make the same form available in Form View and Datasheet View. In fact, most forms are. Users can switch from Form View to Datasheet View by clicking the View menu.
To create a Datasheet form, use the Form Wizard and select its option. You can also design a from from scratch. Then, in the Format or the All tabs of the Properties window, set its Default View to Datasheet
· A Justified form provides a consistent look with borders added to labels
· A split form is made of two sections. The top section displays like a normal Form View and shows one record at a time. The bottom section displays a datasheet view of (all) the records (if the area is big enough):
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.
To create a split form by design, start a form in Design View or display an existing form in Design View. In the Properties window of the form, set its Record Source to the table that holds the value and set its Default Value to Split Form. If it is bran new form without some previously created fields, use the Field List to add the desired fields to it.
The Sections of a Form
The Detail Section
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.
The Form Header and the Form Footer
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:
· Right-click the middle of the form and clickForm Header/Footer
· On the ribbon, you can click Arrange and, in the Show/Hide section, click theForm Header/Footerbutton
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.
Practical Learning:Creating the Sections of a Form
1. While the form is still displaying in Design View, on the ribbon, click Arrange if necessary.
In the Show/Hide section, click the Form Header/Footer button
2. Save the form
The Page Header and the Page Footer
A form can also be equipped with two other sections. To get them, you can:
· Right-click the middle of the form and clickPage Header/Footer
· In the Show/Hide section of the Arrange tab of the ribbon, you can click thePage Header/Footerbutton
Any of these actions would add two new sections to the form: aPage Headerand aForm Headersections. 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 thePage Headerand thePage Footersections
Dividing Lines
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 BooleanDividing Linesproperty. If you set its value toYes, the dividing horizontal lines would display on the form. To hide both lines, you can set this properties value toNo. To hide an individual line, you can completely reduce its section.
Practical Learning:Using Dividing Lines
1. On the form, double-click the button at the intersection of the rulers.
In the Properties window, click the Format tab and set theDividing Linesfield toYes
2. Save the form
The Records of a Form
The Form's Scroll Bars
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 theScroll Barsfield in the Format property page. There are four possible values. To display only the vertical scroll bar, set the value toVertical Only:
In the same way, you can display only the horizontal scroll bar by selectingHorizontal Only. On the other hand, you can display both scroll bars by setting the value toBoth. If for some reason you do not want any scroll bar, set theScroll Barsproperty value toNeither.
The Record Selectors
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 itsRecord Selectorsproperty toNo.
Practical Learning:Hiding the Control Selectors