Presentation is loading. Please wait.

Presentation is loading. Please wait.

Reports, Forms, and Combo Boxes

Similar presentations


Presentation on theme: "Reports, Forms, and Combo Boxes"— Presentation transcript:

1 Reports, Forms, and Combo Boxes
Access Project 4 Reports, Forms, and Combo Boxes In this project, students learn how to create reports and forms. They learn the purpose of the various sections of a report and how to modify the contents of these sections. They use grouping in a report. Students create and use custom forms. They learn how to move controls, create new controls, add combo boxes, and add a title. They also change the characteristics of various objects in a form. General principles to help design effective reports and forms are reviewed. Instructor notes Case Perspective, AC 113 LECTURE NOTES The Case Perspective presents a real-life situation in which Microsoft Access could be used and offers background for the reports and form created in this project (Figures 4-1, 4-2, and 4-3). Review the Case Perspective. Note how Access will be used to create the reports and form. Introduction, AC 194 Use Figure 4-1 to point out the difference between a report and simply printing the contents of a table. Use Figure 4-2 to define grouping (creating separate groups of records that have a common characteristic) and subtotal (total for a group of records). Use Figure 4-3 to describe custom form (like the form from project 1 but with improvements to make the user interface more friendly) and combo boxes. (boxes that allow you to select data entries from a list of valid input) It is much easier to create forms and reports with a DBMS such as Access rather than to write special programs or use report and form generation software packages. Designing reports and forms with a DBMS is easy and fun. Students quickly can see the results of their work by switching between Design view and Form view (forms) and Design view and Print Preview (reports). Project Four – Reports, Forms, and Combo Boxes, AC 197 Make sure students understand that creating forms and reports can increase the size of the database substantially. The remaining projects in the textbook require students to add pictures to tables as well as to forms.

2 Objectives Create a report using the Report Wizard
Use sorting and grouping in a report Move controls Change properties Add totals and subtotals to a report

3 Objectives Align and format controls Remove controls
Change labels and column headings Use multiple tables in a report Remove unwanted controls

4 Objectives Understand report design considerations
Use the Form Wizard to create a form Add a calculated field, combo boxes, and a title to a form Understand form design considerations

5 Creating a Report Using the Report Wizard
Report creation, AC 198 LECTURE NOTES Remind students that they used the Report Wizard in Project 1 (AC 42) to create the Client Amount Report. Discuss More About Creating a Report to explain the alternatives for using Report Wizard. Point out that you use the Report Window to modify a report created with the Report Wizard. A report always uses the most current data in the database. If records are updated after the original report is created, the next time the report is printed it will reflect the changes to the database. As they work through the steps to create reports in this project, students should be encouraged to try out various options. Discuss More About Using Queries for Reports on page AC 204. Creating a report, AC 198 Use Figures 4-4 through 4-14 to illustrate creating a report using the Report Wizard. Use Figures 4-4 through 4-8 to show how to begin creating a report and adding fields to a report with the Report Wizard. Use Figures 4-9 and 4-10 to point out that you can use the Report Wizard to group and sort records. Students will add grouping and sorting options to this report after the initial report is created with the Report Wizard. Use Figures 4-11 and 4-12 to point out the layout and style options available for reports. If students click the different layout and style options, Access will provide a preview in the dialog box. Discuss Figure The title of the report is also the name of the report. Use Figure 4-14 to illustrate the report design created by the Report Wizard. Point out that not all the data in the City field appears. Discuss Other Ways to create a report. If necessary, in the Database window, click Tables on the Objects bar and then click Client Click the New Object button arrow on the Database toolbar Click Report Click Report Wizard and then click the OK button Click the Client Type field and then click the Add Field button Using the same technique, select the Client Number, Name, Address, City, Amount Paid, and Current Due fields Click the Next button Select the Tabular layout and Portrait orientation. Be sure the Adjust the field width so all fields fit on a page check box is selected If Corporate is not already selected, click Corporate to select it Click the Next button and then type Client Account Summary as the report title Click the Finish button Click the Close button in the window containing the report to close the report Using design view, AC 202 Point out that within the Report window there are three possible views: Design view, Print Preview, and Layout Preview. The two most useful views are Design view and Print Preview. Students can switch from Design view to Print Preview by clicking the Print Preview button on the Report Design toolbar. To return to Design view, click the Close button on the Print Preview toolbar. The ease with which you can switch between views means that students can make a change to the design of the report and immediately see the effect of the change. Define docking. Use Figures 4-15 and 4-16 to illustrate moving to Design view and docking the toolbar. Use Figure 4-15 to point out the field list and the toolbox. The field list includes all the fields in the query or table on which the report is based. Students use the toolbox to add controls to the report. Use Figure 4-16 to point out that the toolbox is docked at the bottom of the screen. If possible, demonstrate the procedure for moving the toolbox.

6 Using Sorting and Grouping
Report Sections, AC 204 LECTURE NOTES Define section (each portion of the report) , Report Header section (prints once at the beginning of the report), Report Footer section (prints once at the end of the report), Page Header section (prints once per page at top of page), Page Footer section (prints once per page at bottom of page), Detail section (prints once per record in table/query datasheet, and controls. (text boxes or value of field in the detail section) Point out the various sections on Figure Students should understand the order of the sections and when the contents of each section print. Each object on the report is a control. The controls in the Detail section display the contents of the corresponding fields. The controls in the Report Header and Page Header sections are labels. To select a control, click it. Small squares called sizing handles appear around the border of the control. You can move, resize, delete, and modify controls. Figure 4-20 illustrates a control that has been selected. Discuss More About Report Sections. Discuss the Q&A on page AC 216. Sorting and grouping, AC 204 Review the definition of grouping. Grouping means creating separate collections of records sharing some common characteristic. In some other DBMS packages, the data first must be sorted by the grouping field before the report is created. Define group header (printed before records in a group) and group footer. (printed after the records in a group) Point out that in Client Account Summary report shown in Figure 4-1, records are grouped by client type. Use Figures 4-17 through 4-19 to illustrate using the Sorting and Grouping button to group records by client type and sort records by Name within the client type group. Point out the Client Type Header and Client Type Footer sections in Figure You also can specify sorting and grouping options in the Report Wizard dialog boxes. Discuss More About Grouping in a Report. Click the Sorting and Grouping button on the Report Design toolbar Click the down arrow in the Field/Expression box, and then click the Client Type field in the list Click the Group Header property box, click the Group Header box arrow, and then click Yes Click the Group Footer property box, click the Group Footer box arrow, and then click Yes Click the Keep Together property box, click the Keep Together box arrow, and then click With First Detail Click the second row in the Field/Expression column, click the arrow, and then select the Name field Close the Sorting and Grouping dialog box by clicking its Close button DISCUSSION TOPICS Andrew Lang, Scottish author, once wrote about a popular public figure, “He uses statistics as a drunken man uses lamp posts – for support, not for illumination.” Some people believe that the statistics, or data, in a report are grouped more often to support the writer’s agenda than to shed light onilluminate, or clarify, the data. How can grouping make a report more valuable? Could grouping make a report misleading? How? Can anything be done to ensure that grouping does not compromise a report’s accuracy? QUICK QUIZZES What does grouping do in a report? (Answer: Grouping arranges the records in a report into separate collections of records that share a common characteristic)

7 Moving a Control Click the Client Type control in the Detail section
Point to the border of the control, but not to a handle. The mouse pointer should change shape to a hand. Once you are pointing in the correct position, drag the control to the left edge of the Client Type Header section

8 Changing the Can Grow Property
Changing properties, AC 207 LECTURE NOTES Define property sheet. (for each control, a list of properties that can be changed) Students use the property sheet extensively in this project and the following projects. Explain the three approaches to solving the missing data problem. Use Figures 4-21 through 4-24 to explain changing the Can Grow property. Point out the changes to the report in Figure 4-24. Right-click below the section selector for the Detail section Click Properties and then, if necessary, click the All tab to ensure that all available properties appear Click the Can Grow property, click the Can Grow property box arrow, and then click Yes in the list that appears Close the property sheet by clicking its Close button Click the Print Preview button

9 Adding Totals and Subtotals
Adding totals and subtotals, AC 209 LECTURE NOTES Define text box. (a control that displays the data) Review the aggregate functions. (pg 209 COUNT, SUM, AVG, MAX, MIN, STDEV, VAR, FIRST, LAST). These are the same functions students used with queries in Project 2. The most useful functions for use in a report are: COUNT, SUM, and AVG. Point out that where you perform the calculation in the report makes a difference. If the calculation is done in the group footer section, Access only will perform the calculation for records in the group. Use Figures 4-25 through 4-32 to illustrate adding subtotals and totals. Discuss the Q&A. Click the Close button on the toolbar to return to Design view Click the Text Box tool in the toolbox, and then point to and click the position shown in Figure 4-25 on page AC 209 Type =Sum([Current Due]) in the control, and then press the ENTER key Click the label to select it, and then press the DELETE key to delete the label Use the Text Box tool to add a second control in the position shown in Figure 4-29 on pace AC 210 Type =Sum([Amount Paid]) in the control, and then press the ENTER key Click the label to select it Click the label a second time to produce an insertion point Use the DELETE or BACKSPACE key to delete the Text21 (your number might be different) Type Subtotal as the label Click outside the label to deselect the label Click the label a second time to select it Move the label to the position shown in Figure 4-31 on page AC 211 by dragging the Move handle in the upper-left corner Use these techniques to add the controls in the Report Footer second shown on the following slide. The only difference is that the label reads Grand Total: rather than Subtotal:. The expressions in both labels are the same as the expressions you entered earlier

10 Aligning Controls Aligning controls, AC 211 LECTURE NOTES
Use Figure 4-33 to illustrate using the horizontal ruler to select multiple controls. You also can select multiple controls by clicking the first control and then holding down the shift key and clicking each of the other controls. Use Figures 4-34 through 4-36 to illustrate aligning controls. Click the horizontal ruler above the Current Due controls Click Format on the menu bar and then point to Align Click Right on the Align submenu Click the Amount Paid control in the Page Header section to select it Press and hold the SHIFT key and then click the Amount Paid controls in the Detail, Client Type Footer, and Report Footer sections to select them Click Format on the menu bar, point to Align, and click Right on the Align submenu Click the left ruler below the section selector for the Client Type Footer section Click Format on the menu bar, point to Align, and click Top on the Align submenu Use the same techniques to top-align the controls in the Report Footer section

11 Formatting Controls Formatting controls, AC 214 LECTURE NOTES
Point out that you can use either the property sheet or the Formatting toolbar to make changes to the format of controls. Use Figures 4-37 through 4-40 to describe formatting controls. Use Figures 4-37 and 4-38 to illustrate using the Formatting toolbar to change the font and color. Use Figures 4-39 and 4-40 to illustrate using the property sheet to change the format of the subtotal and total controls. Click the label containing the word, Subtotal, in the Client Type Footer section Press and hold the SHIFT key and then click the label containing the words, Grand Total, in the Report Footer section Click the Font Size arrow on the Formatting (Form/Report) toolbar and then click 8 as the new size Click the Italic button on the same toolbar Click the Font/Fore Color button arrow on the Formatting (Form/Report) toolbar Click the color in the second row and first column Click the control for the sum of Amount Paid in the Client Type Footer section Press and hold the SHIFT key and click the control for the sum of Amount Paid in the Report Footer section, the control for the sum of Current Due in the Client Type Footer section, and the control for the sum of Current Due in the Report Footer section Right-click any of the selected controls Click Properties on the shortcut menu Click the Format tab to display only the Format properties, click the Format property box, click the Format property box arrow, and then select Currency Close the property sheet by clicking its Close button

12 Creating a Report that Invokes Multiple Tables
Creating a report involving multiple tables, AC 217 LECTURE NOTES Use Figures 4-41 through 4-51 to illustrate creating a report that involves multiple tables. Use Figures 4-41 and 4-42 to describe using the Report Wizard to select fields from multiple tables for a report. Use Figures 4-43 through 4-45 to illustrate defining the grouping and sorting options for the report. Use Figure 4-47 to point out the summary options for the report. In the Client Account Summary report, the summary statistics were calculated in the Report Design window by adding text boxes. Use Figures 4-48 and 4-49 to point out the layout and format options for the report. If students click the different layout and style options, Access will provide a preview in the dialog box. Discuss Figure The title of the report is also the name of the report. Use Figure 4-51 to illustrate the report design created by the Report Wizard. Point out the truncated headings, the missing data in the Detail section, and the summary messages. In the Database window, click the Tables object and then click Trainer Click the New Object button arrow on the Database toolbar Click Report, click Report Wizard, and then click the OK button Click the Add Field button to add the Trainer Number field Add the First Name field by clicking it and then clicking the Add Field button Add the Last Name field in the same manner Click the Tables/Queries arrow, and then click Table: Client in the Tables/Queries list box Add the Client Number, Name, Amount Paid, and Current Due fields by clicking the field and then clicking the Add Field button Click the Next button Because the report is to be viewed by trainer and by Trainer already is selected, click the Next button Because no additional grouping levels are required, click the Next button Click the box arrow in the text box labeled 1 and then click the Client Number field in the list Click the Summary Options button Click the Sum check box in the Amount Paid row and the Sum check box in the Current Due row Click the OK button and then click the Next button Select the Stepped layout and Portrait orientation If necessary, click Corporate to select it Click the Next button, and then type Trainer/Client Report as the report title Click the Finish button Close the report by clicking the Close Window button for the window containing the report

13 Changing the Column Headings
Removing Unwanted Controls Be sure the Reports object is selected in the Database window, right-click Trainer/Client Report, and then click Design View on the shortcut menu If a field list appears, remove it from the screen by clicking its Close button If necessary, maximize the window Click the control at the top of the Trainer Number Footer section Press the DELETE key to delete it Click the control that reads SUM, then press the delete key to delete the control Click the control that reads Grand Total, then press the delete key to delete the control TROUBLESHOOTING TIPS: Tell students that if they accidentally delete a control, they can restore it by immediately clicking Undo Delete on the Edit menu. Changing the column Headings Point immediately after the second r in Trainer in the heading for the first field Click the column heading for the first field to select it Click it a second time to produce an insertion point behind the r, press the DELETE key to delete the space between Trainer and Number, and then press SHIFT+ENTER to extend the headings over two lines Using the same technique, change all the two word headings Report design considerations, AC 227 LECTURE NOTES Discuss with students the four guidelines to keep in mind when designing and creating reports. Reports should be user-friendly and “pleasing to the eye.” Also, users make judgments about the database based on output. If the output is unprofessional, then users may question the accuracy of the underlying data. Discuss More About Report Design on page AC 225.

14 Adding a Calculated Field
Creating and using custom forms, AC 227 LECTURE NOTES Discuss the advantages of custom forms. Fields can be arranged in a more natural way. Use of color and boxes can highlight certain areas and improve the visual appeal of the form. Beginning the form creation, AC 227 LECTURE NOTES Use Figures 4-58 through 4-60 to explain how to begin creating a form. You can create forms from tables or from queries. Discuss More About Creating Forms. Consider Other Ways to create a form. Begin Creating a Form Make sure the Tables object is selected and then click Client Click the New Object button arrow, click Form, and then click Form Wizard. Click the OK button Use the Add Field button to add all the fields except the Client Type and Trainer Number fields Click the Next button When asked for a layout, be sure Columnar is selected, and then click the Next button again Be sure Standard is selected, click the Next button, and then type Client Update Form as the title for the form Click the Finish button to complete and display the form Click the Close Window button for the Client Update Form window to close the form Modifying the form design, AC 229 LECTURE NOTES Define controls (all information on a report/form is contained in controls), bound controls (displays data that comes from the database), attached labels (label for database field to the left of the data field), unbound controls (not associated to the database data; it is used to display the forms title, etc.), and calculated controls (displays data calculated from database data i.e. total amount = amount paid – current due). Make sure students understand the difference between a bound control and an unbound control. Point out that a calculated control is a form of an unbound control. Students manipulate controls on a form in exactly the same way as they did with reports. Use Figures 4-61 through 4-63 to illustrate modifying the form design by moving controls on a form. Adding a calculated field, AC 232 LECTURE NOTES Use Figures 4-64 through 4-66 to illustrate adding a calculated field. Use Figures 4-64 and 4-65 to describe using the Text Box tool to place a text box on the form. Explain how to enter an expression for the calculated control on Figure Emphasize that field names must be enclosed in brackets. Use Figure 4-66 to explaining moving an attached label. Discuss More About Adding a Calculated Control on page AC 233. Adding a Calculated Field Click the Text Box tool in the toolbox, and then move the mouse pointer, which has changed shape to a small plus symbol accompanied by a text box, to the position shown in Figure 4-64 on page AC 232 Click the position to place a text box Click inside the text box and type =[Amount Paid]+[Current Due] as the expression in the text box Click the attached label twice, once to select it, and a second time to produce an insertion point Use the DELETE key or the BACKSPACE key to delete the current entry Type Total Amount as the new entry Click outside the Total Amount control to deselect it, and then click the control to select it once more. Handles will appear around the control Move the label portion so its left edge lines up with the labels for the Amount Paid and Current Due fields by dragging the move handle in its upper-left corner

15 Placing a Combo Box that Selects Values from a List
Combo boxes, AC 234 LECTURE NOTES There are many advantages to using a combo box on a form. A combo box allows users to select a value from a drop-down list or type a value. Values in the drop-down list can be entered when the combo box is created or the combo box can select values from a table. Combo boxes assist with the data entry process and help ensure the accuracy of the data. A list box is similar to a combo box except that you cannot type values. You only can select them from a list. Combo boxes are more flexible. Use Figures 4-68 through 4-72 to illustrate placing a combo box that selects values from a list. Use Figure 4-68 to explain placing the combo box on the form. Use Figures 4-69 through 4-72 to describe using the Combo Box Wizard to create a combo box that selects values from a list. Use Figures 4-73 through 4-79 to illustrate using the Combo Box Wizard to create a combo box that selects values from a table. Discuss the Q&A on page AC 240. Click the Control Wizards tool in the toolbox to select it Click the Combo Box tool in the toolbox, and then move the mouse pointer, whose shape has changed to a small plus symbol accompanied by a combo box, to the position shown in Figure 4-68 on page AC 235 Click the position If necessary, click the “I will type in the values that I want.” option button to select it Click the Next button in the Combo Box Wizard dialog box, click the first row of the table, and then type EDU as the entry Press the DOWN ARROW key and then type MAN as the entry Press the DOWN ARROW key again and then type SER as the entry Click the Next button Click the “Store that value in this field:” option button Click the “Store that value in this field:” box arrow and then click Client Type Type Client Type as the label for the combo box Click the Finish button Click the label for the combo box, and then drag its move handle to move the label so its left edge aligns with the left edge of the labels for the Amount Paid, Current Due, and Total Amount fields

16 Adding a Title Adding a title, AC LECTURE NOTES
Use Figure 4-80 to describe how to enlarge the Form Header. Use Figures 4-81 and 4-82 to illustrate adding a title. Enhancing a title, AC 242 Use Figures 4-83 through 4-87 to explain enhancing the title. Discuss Figure Point out the property sheet in Figure Mention that the list of properties is extensive. Use Figures 4-85 through 4-87 to illustrate changing the properties of the title. Point to the bottom border of the Form Header section. The mouse pointer changes shape to a two-headed vertical arrow with a crossbar Drag the bottom border of the Form Header section to resize the Form Header section to the approximate size shown in Figure 4-80 on page AC 241 Click the Label tool in the toolbox and then move the mouse pointer, whose shape has changed to a small plus symbol accompanied by a label, to the approximate position shown Click the mouse pointer in the position in the figure, and then type Client Update Form as the contents of the label Click outside the label to deselect it Click the label to select it once again Drag the handle in the lower-right corner to expand the label to the size shown on the following slide

17 Summary Create a report using the Report Wizard
Use sorting and grouping in a report Move controls Change properties Add totals and subtotals to a report

18 Summary Align and format controls Remove controls
Change labels and column headings Use multiple tables in a report Remove unwanted controls

19 Summary Understand report design considerations
Use the Form Wizard to create a form Add a calculated field, combo boxes, and a title to a form Understand form design considerations

20 Access Project 4 Complete


Download ppt "Reports, Forms, and Combo Boxes"

Similar presentations


Ads by Google