






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Decision Making
Using Access
Introduction This plug-in focuses on the two functions of decision making using Access: creating forms and creating reports. A form is nothing more than a graphical representation of a table. You can add, update, and delete records in your table by using a form. Al- though a form can be named different from a table, they both still manipulate the same information and the same data. Hence, if you change a record in a form, it will be changed in the table as well. A form is useful when you have numerous fields in a table. This way you can see all the fields in one screen, whereas if you were in the table view (datasheet) you would have to keep scrolling to get the field you desire. A report is an effective way to present your data in a printed format. Because you have control over the size and appearance of everything on a report, you can dis- play the information the way you want to see it.
Forms An Access form is a window, similar to a dialog box, that contains a set of controls (such as labels, text boxes, and check boxes) to view, enter, or edit database infor- mation, typically one record at a time. In a form, data are obtained directly from one or more tables or data that have been extracted using a query. Although it is possible to directly enter and edit the information in tables in Datasheet view, a database usually includes a set of forms, which can make entering and editing data considerably easier and can limit the fields that can be viewed or modified.
Forms allow you to enter data one record at a time. Often, it is easier to enter data in a well-designed form rather than in a wide datasheet. You can create a form that has fields from more than one table or query. Like other wizards, the Form Wizard walks you step-by-step through the process of creating a form. To create a form using the Form Wizard:
from the data file that accompanies this text.
next step.
When you select the fields for your form in the first Form Wizard dialog box, you can add fields from several tables or queries. To add fields from each table or query, select it in the Tables/Queries drop-down list and then use the buttons to move the fields you want to the Selected Fields list. If you add fields from several forms or queries, the wizard will display one or two additional dialog boxes that weren’t shown in the previous section: one dialog box in which you specify the form or query by which you want to view your data (for ex- ample, if you selected fields from the CUSTOMER and the BIKE tables, you would choose to view your data either “by Customer” or “by Bike”) and possibly another dialog box in which you select a layout for a subform. The choices you make deter- mine the form’s record source. If your form includes fields from two tables that are related in a one-to-many relation- ship and if you selected to view your data by the primary table, the wizard will let you display the records from the related table in a subform contained within the form. As an alternative, the wizard will let you set up a linked form, which is a separate form that dis- plays the related data and which you open by clicking a button on the main form. On the other hand, if you chose to view your data by the related table in the one- to-many relationship, when the form displays a record in the related table, it will simply display the unique matching fields from the primary table along with the fields from the current record in the related table. A form that accesses data from several tables or queries can be complex to de- sign from scratch or to modify. However, if you create the form using the Form Wiz- ard, almost everything is set up for you.
The AutoForm Wizard is the quickest and easiest way to create a form. There are five types of AutoForms: (1) Columnar, (2) Tabular, (3) Datasheet, (4) PivotTable, and (5) PivotChart. The Columnar Form is the default format.
FIGURE T8. Create a Form by Using Wizard
clicking the Close box in the upper-right corner.
made (refer to Figure T8.3).
Not all controls on your form may be of equal importance. You may want to modify the look of a specific control to make it stand out, or you may want to modify the control behavior. When designing forms, be careful not to over-design. Too many different colors, styles, or behaviors can distract from accurate data entry. To modify the properties of a specific control (refer to Figure T8.3):
form, you should create one.
key to move the selected objects down enough for you to enter a form title label.
changes to a plus (+) sign.
FORM inside the label box.
Some properties have a drop-down list with specific choices. For other proper- ties, you enter a specific value.
FIGURE T8. Modify Form Properties and Controls
View button Auto Format button Properties button
Select control
Control properties
Note: Common properties to modify are the use of scroll bars and growing or shrink- ing the size of the control based on data the user enters. If you turn off scroll bars, users can only see the data that fits within the specific control dimensions. If you turn on Can Grow or Can Shrink , the control area will grow and/or shrink to fit the data. Many formatting options are available from the shortcut menu (selecting a con- trol, then right mouse click). You can change the background color, font color, and which special effect is applied to the control.
To give your form a professional look, make sure that controls are aligned evenly. You can use the form rulers or display the form grid to give you visual guidelines. Rather than trying to manually align controls, use the Access alignment tools. You can select multiple controls and then align them by the left side, right side, top, or bottom. To align controls in a form:
Note: Use left or right alignment for controls that are in the same column. Use top or bottom alignment for controls that are in the same row.
FIGURE T8.
Modify Form Properties
Select controls
the Shift key when selecting) and move to the right a few spaces using the right arrow key. Do not worry if some of the controls overlap.
plays the modified report.
FIGURE T8.
View Report
FIGURE T8.
Modified Report Properties
Note: Change the graphic style of the report by clicking the AutoFormat toolbar button. The AutoFormat style list is the same list of styles that you choose from when creating a report using the Report Wizard.
The default page orientation for a report is portrait. This means the height of the page is greater than the width. You may want to change this orientation to accom- modate multiple columns of data so they fit on one page. Margins are the blank spaces at the top, bottom, left, and right of a report. By adjusting the page margins, you can control the number of records printed on each page. Use the dialog box to adjust margins and page orientation for your reports. Here is a description on how to change the margins for a report:
To change the page orientation for a report:
Note: When you print a report, Access prints the data along with all graphic ele- ments associated with the report’s AutoFormat. To print only the data and not the graphic elements of a report, select the Print Data Only check box on the Margins tab of the Page Setup dialog box.
to say Books By Publisher. Align the columns evenly and use a profession- al looking font style and layout. Save the report as Publishers.
TechIT Seminars is an organization of inde- pendent seminar facilitators who provide onsite technical training to large businesses around the world. The facilitators build cur- riculum that is marketed by TechIT. TechIT books the seminars, arranges facilities, en- rolls participants, and collects the money. While the facilitators are not employees of TechIT, they provide the service that is mar- keted, and their skills and schedules need to be available to all TechIT offices. Deborah Wallbridge has been charged with tracking facilitators and their classification. She has asked you to help develop a form and a few reports to assist in scheduling seminars.
T8_TechITSeminars_Data.mdb file.
ITATOR table. Set the form background color to a blue color (hue). Organize and align all controls for effective use and full data display. For the phone data, use the Phone input mask. Save the form as Facilitators Form.
a report listing the students currently enrolled in each seminar. The report field order is Seminar ID, Last Name, First Name, Phone Number, and Student Number. Adjust all controls to display all of their contents. Adjust the color and content of the column headings as shown in Figure T8.7. Align all controls. Add a gray line above and below the column headings. Use Sorting and Grouping to sort by Seminar ID, Last Name, and First Name. Place the report date, time, and Page XX of XX in the Page Foot- er. Format the date and time to long format. Save the report as Students By Seminar Report.
Johnny Krol, introduced in Plug-In T7, runs a body shop that specializes in restoring classic cars. Johnny owns three classics and began collecting scale models when his wife put her foot down and said no to building more garage space for his cars. Johnny has decided that he needs a form and a few reports created to help in identifying the buying habits of his customers. Johnny has provided you with an updated database file, T8_ClassicCars_Data.mdb. Specifically, Johnny wants you to:
The form should use a Columnar format and the Sandstone style. Save the form as Catalog.
fields from the CATALOG table, sort by model name, and calculate the average price for each make. Use the Formal style. Save the report as Cars By Model.
FIGURE T8. Students by Seminar Report