18
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 the Hotel Management1 database 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 to Central and 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 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. Practical Learning: Specifying the Caption of a Form Copyright © 2008-2015, FunctionX, Inc. page 1

 · Web viewA 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

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1:  · Web viewA 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

 

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' Properties1. Start Microsoft Access and open the Hotel Management1 database you started in the

previous lesson2. To create a new form, on the ribbon, click Create and, in the Forms section, click Blank

Form3. To save the new form, right-click the Form1 tab and click Save4. Set the name to Central and press Enter5. 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 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.

Practical Learning: Specifying the Caption of a Form1. In the Properties window of the form, click the Format tab and click Caption2. Type Main Switchboard and press Enter3. 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 button   that you can use to close the

Copyright © 2008-2015, FunctionX, Inc. page 1

Page 2:  · Web viewA 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.

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:

Copyright © 2008-2015, FunctionX, Inc. page 2

Page 3:  · Web viewA 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

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.

The Min/Max ButtonsInstead 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 Buttonsproperties. 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:

Min Max Buttons Result System Buttons ConsequenceMinimize 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 Form1. Click the Office Button and click Access Options2. In the left frame, click Current Database3. In the right frame, in the Document Window Options, click the Overlapping Windows radio

button4. Click OK5. On the Microsoft Office Access message box, click OK6. Close Microsoft Access

Copyright © 2008-2015, FunctionX, Inc. page 3

Page 4:  · Web viewA 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

7. Restart Microsoft Access and re-open the Hotel Management1 database8. To reopen the Central form, in the Navigation Pane, right-click Central and click Design

View

The Form’s BordersWhether 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.

Form LayoutThe 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:

Copyright © 2008-2015, FunctionX, Inc. page 4

Page 5:  · Web viewA 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

 

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 its Default View to Continuous 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):

Copyright © 2008-2015, FunctionX, Inc. page 5

Page 6:  · Web viewA 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

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 FooterBesides 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 click Form Header/Footer On the ribbon, you can click Arrange and, in the Show/Hide section, click the Form

Header/Footer button 

Copyright © 2008-2015, FunctionX, Inc. page 6

Page 7:  · Web viewA 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

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 Form1. 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 FooterA form can also be equipped with two other sections. To get them, you can:

Right-click the middle of the form and click Page Header/Footer In the Show/Hide section of the Arrange tab of the ribbon, you can click the Page

Header/Footer button 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

Dividing LinesA 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

Copyright © 2008-2015, FunctionX, Inc. page 7

Page 8:  · Web viewA 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

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.

Practical Learning: Using Dividing Lines1. On the form, double-click the button at the intersection of the rulers.

In the Properties window, click the Format tab and set the Dividing Lines field to Yes2. 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 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:

Copyright © 2008-2015, FunctionX, Inc. page 8

Page 9:  · Web viewA 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

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.

The Record SelectorsA 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:

Copyright © 2008-2015, FunctionX, Inc. page 9

Page 10:  · Web viewA 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

If you do not want a form to display the record selector(s), in its Design View, set its  Record Selectors property to No.

Practical Learning: Hiding the Control Selectors1. In the Properties window, click the Format tab and double-click Record Selectors to set

its value to No2. Save the form3. To preview the form, on the right side of the status bar, click the Form View button4. To return to Design View, right-click the title bar of the Central form and click Design View

Navigation ButtonsIn 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.

Practical Learning: Configuring the Navigation Buttons1. In the Format tab of the Properties window, double-click Navigation Buttons to set its

value to No2. To preview the form, right-click the Central tab and click the Form View button3. To return to Design View, on the right side of the status bar Form View4. Save the form

Navigation CaptionBy 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):

Copyright © 2008-2015, FunctionX, Inc. page 10

Page 11:  · Web viewA 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

The Size of a Form The Width of a Form

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.

Practical Learning: Changing the Width of a Form1. Double-click the button at the intersection of the rulers.

In the Format tab of the Properties window, click Width2. Type 4.5 and press Enter

The Height of a FormThe 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

Copyright © 2008-2015, FunctionX, Inc. page 11

Page 12:  · Web viewA 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

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.

Practical Learning: Changing the Height of a Form1. On the form, double-click the Form Header bar2. In the Format tab of the Properties window, click Height and type .53. On the form, click the Detail bar4. In the Format tab of the Properties window, click Height and type 2.55. On the form, click the Form Footer bar6. In the Format tab of the Properties window, click Height and type .35 and press Enter7. Save the form

Both the Width and Height of a FormTo 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.

Automatically Centering a FormWhen 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 Yesfrom its  default No value.

Fitting the ScreenWhile designing a form, you may stretch its right and/or its bottom borders beyond the actual borders of the form. Consider the following screenshot:

Copyright © 2008-2015, FunctionX, Inc. page 12

Page 13:  · Web viewA 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

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  .

The Background Picture of a Form Introduction

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

Copyright © 2008-2015, FunctionX, Inc. page 13

Page 14:  · Web viewA 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

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:

Practical Learning: Setting the Background of a Form1. From the resources that accompany our lessons, open the Danilo Pizza1 database2. In the Navigation Pane, under Pizza Orders: Table, double-click (the) Pizza Orders (form) to

Copyright © 2008-2015, FunctionX, Inc. page 14

Page 15:  · Web viewA 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

open it3. After viewing the form, to change its view, right-click its tab and click Design View

4. Double-click the button at the intersection of both rulers   to access the properties of the form. In the Properties window, click the Format tab and click Picture

5. Click the ellipsis button   of the Picture property. Locate the pizza.bmp file, click and open. If you receive a Microsoft Office Access Security Notice, read it and click Open

6. Save the form

Linking or Embedding the PictureAfter 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:

If you set the Picture Type to Linked, the file name of the picture (with its extension) would be set as the value of the Picture property

If you set the Picture Type to Embedded, you would be asked to first remove the value of the Picture property. You must specify the picture again. This time, the (whole) path of the file name would be set as the value of the Picture property. 

The Picture AlignmentIn 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 Alignmentproperty  whose default value is Center. If you want the smaller picture to be

Copyright © 2008-2015, FunctionX, Inc. page 15

Page 16:  · Web viewA 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

positioned in one of the sections, select another value from this property. If you select:

Top Left: If the form has only a Detail section, the picture would be positioned from under the Form Header bar but to the left side of the section.If the picture is taller than the Form Header section, it would span down to the Detail section 

 If you want such a picture to display only in the Form Header section, when designing it, make it shorter and set the height of the Form Header section accordingly

Top Right: If the form has only a Detail section, the picture would be positioned from under the Form Header bar but to the right side of the section.If the picture is taller than the Form Header section, it would span down to the Detail section. If you want such a picture to display only in the Form Header section, when designing it, make it as tall as the intended height of the Form Header section

Center and Form Center: The picture would be positioned in the middle of the Detail section

Bottom Left: If the form has only a Detail section, the picture would be positioned above the Form Footer bar to the left side of the section.If the picture is taller than the Form Header section, it would span up to the Detail section 

 If you want such a picture to display only in the Form Footer section, design it and make it as tall as the eventual height of the Form Header section

Bottom Right: If the form has only a Detail section, the picture would be positioned above the Form Footer bar to the right side.If the picture is taller than the Form Header section, it would span up to the Detail section. If you want the picture to display only in the Form Footer section, when designing it, make it as tall as the height you will specify for the Form Header section

Practical Learning: Aligning the Background1. Set the Picture Alignment to Top Left2. Save and preview the form

Copyright © 2008-2015, FunctionX, Inc. page 16

Page 17:  · Web viewA 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

 

3. Close the form

Tiling the PictureIf 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:

Copyright © 2008-2015, FunctionX, Inc. page 17

Page 18:  · Web viewA 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

Zooming or Stretching a PictureIf 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:

Clip: This is the default value. Its effect depends on the Picture Alignment and the Picture Tiling properties

Stretch: When this option is selected, the picture size would be expanded so that its corners (top-left, top-right, bottom-right, and bottom-left) touch the corners of the form. Here is an example: 

Copyright © 2008-2015, FunctionX, Inc. page 18

Page 19:  · Web viewA 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

If the form is resized, the background picture would be stretched so its corners are the same as those of the form. Here is an example of the above form resized: 

Stretch Horizontal: When this option is selected, the picture would be expanded horizontally so that its left border touches the left border of the form and the right border of the picture would touch the right border of the form. If the form is resized, the background picture would be stretched also. Its left and right borders would still touch the left and right borders of the form

Stretch Vertical: If this value is set, the picture would be heightened or shortened so its top border touches the top border of the form and the bottom border of the picture would touch the bottom border of the form. If the form is resized, the picture would be stretched also: its top and bottom borders would correspond to the top and the bottom borders of the form

Zoom: To start, Microsoft Access would get the height and the width of the picture, then it would calculate their rate to get a fraction such as 1/2, or 3/4, or 7/5, etc. When this option is selected, the picture would be stretched proportionally using the calculated rate. When stretching, once a border of a picture reaches a border of the form, the other border would not be stretched anymore. As a consequence, if the rate of the dimensions of the form is not the same as the rate of the dimensions of the picture, two sides of the form would not be covered. Consider the following: 

Copyright © 2008-2015, FunctionX, Inc. page 19

Page 20:  · Web viewA 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

 Notice that the picture is square, which means the rate of its height and width is 1. The form is rectangular, which means the rate of its height and width is different than 1. If you set the Picture Size Mode property to Zoom, you would get the following result: 

 If you resize the form, the picture also may be stretched but it would keep the rate of its height/width.

Characteristics of the Sections of a Form The Background Color of a Section

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:

Copyright © 2008-2015, FunctionX, Inc. page 20

Page 21:  · Web viewA 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

On the ribbon, click Home and, in the Font section, select a color from the Fill/Back Colorbutton 

Right-click a section, position the mouse on Fill/Back Color and click the desired color 

On the ribbon, click Design and, in the Font section, select a color from the Fill/Back Colorbutton 

Access the Properties window of the section. In the Format or the All tab, click the Back Colorfield. If you click the arrow of the property, you can select a familiar color from the list. Otherwise, you can click the browse button. This would display a list of colors similar to that of the Font/Fore Color window

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.

Practical Learning: Setting Background Color1. The Central form of Hotel Management1 database should still be opened in Design View.

On the form, click the Form Header bar to select its section2. On the ribbon, click Home.

In the Font section, click the arrow of the Fill/Back Color button   and select Dark Blue 5 (4th column - 6th row)

3. On the form, right-click under the Detail bar, position the mouse on Fill/Back Color and click Medium Gray 2 (3rd column - 3rd row)

4. On the form, double-click the section under the Form Footer bar5. In the Properties window, click the Format bar and click Back Color6. Click the arrow of the field and select Background Form7. To save the form, press Ctrl + S

Special EffectsMicrosoft 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.

Copyright © 2008-2015, FunctionX, Inc. page 21

Page 22:  · Web viewA 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

Practical Learning: Using Special Effects1. The Central form should still be opened in Design View.

On the form, click the Form Header bar2. In the Format tab of the Properties window, click Special Effect and click the arrow of the

field to select Raised3. On the form, click under the Form Footer bar4. In the Format tab of the Properties window, double-click Special Effect to set its value

to Raised5.  Save the form

Automatic Design of a Form Microsoft Access Design Templates

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

Use the Form Wizard to create the form and select a design on the third page of the wizard 

If the form has been created already, open or display it in Design View. On the ribbon, click Arrange. In the AutoFormat section, click the AutoFormat button. This would display a window with the available formats 

Copyright © 2008-2015, FunctionX, Inc. page 22

Page 23:  · Web viewA 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

 Each format has a name that appears as a tool tip when you position the mouse on it. To apply one of the formats to your form, simply click it.You can also click the AutoFormat Wizard... button and, in the dialog box, select the desired design

Display the form in Layout View. To do this, in the Navigation Pane, you can right-click the form and click Layout View. If the form is currently opened, on the right side of the status bar, you can click the Layout View button. Once in the Form Layout View, in the AutoFormat section, click one of the buttons in the left section. If you click the More button, a window would come up and would display a window with the preview. If you see a format you want, you can click it.If you click the More button, you can then click the AutoFormat Wizard... button and, in the dialog box, select the desired design

Creating a Form DesignIf 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:

Open or display the form in Design View. On the ribbon, click Arrange. In the AutoFormat section, click the AutoFormat button and, in the window that appears, click the AutoFormat Wizard button... 

Copyright © 2008-2015, FunctionX, Inc. page 23

Page 24:  · Web viewA 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

 In the AutoFormat dialog box, you can click the Customize... button.

Display the form in Layout View and, in the AutoFormat section of the Format category of the ribbon, click the More button, click AutoFormat, and click Customize...

In the Customize AutoFormat dialog box, you can click the Create A New AutoFormat Based radio button and click OK

 Dialog Boxes Introduction

A dialog box is a rectangular object that is used to host or carry other controls:

Copyright © 2008-2015, FunctionX, Inc. page 24

Page 25:  · Web viewA 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

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.

Creating a Dialog BoxThere are various ways you can create a dialog box in Microsoft Office Access 2007:

To let the application generate a dialog box for you, on the Ribbon, click Create. In the Forms section, click More Forms -> Modal Dialog

To create the dialog box yourself, start a form in Design View. To convert an existing form into a dialog box, set its Border Style property value to Dialog. This reduces the system buttons to the Close button only

There are two types of dialog boxes: modal and modeless.

Practical Learning: Creating a Modal Dialog Box1. From the resources that accompany these lessons, open the Bethesda Car Rental1

database2. On the Ribbon, click Create and, in the Forms section, click Form Design3. Double-click the button at the intersection of the rulers to access its properties.

In the Properties window, click the Format tab and click Border Style. Then click the arrow of the Border Style field and select Dialog

4. Switch it to Form View to preview5. Save the form as RentalRates and switch it back to Design View6. In the Properties window, click the Format tab and click Caption7. Type Bethesda Car Rental - Rental Rates and press Enter8. Click Width. Type 4.375 and press Enter9. To complete the dialog box, in the Format tab of the Properties window, change the

following properties:Auto Center: YesRecord Selectors = NoNavigation Buttons = No

10. Click the Detail bar to select it. Then, in the Format tab of the Properties window, click Height. Type 1.875 and press Enter

Copyright © 2008-2015, FunctionX, Inc. page 25

Page 26:  · Web viewA 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

11. Preview and save the form12. Switch it back to Design View

Modal Dialog BoxesA 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.

Modeless Dialog BoxesA 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.

Practical Learning: Creating a Modeless Dialog Box1. The Bethesda Car Rental1 database should still be opened with the Rental Rates dialog

box in Design View.To make it a modeless dialog box, in the Properties window, click the Other tab. Double-click Pop Up to change its value from No to Yes

2. Save and close the Rental Rates dialog box   Exercises  Yugo National Bank

1. Open the Yugo National Bank1 database2. Configure the database to display in overlapping windows

Copyright © 2008-2015, FunctionX, Inc. page 26

Page 27:  · Web viewA 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

Watts A loan1. Open the Watts A Loan1 database2. Configure the database to display in overlapping windows

 

Copyright © 2008-2015, FunctionX, Inc. page 27