Presentation is loading. Please wait.

Presentation is loading. Please wait.

Creating Custom Reports, Macros, and Switchboards

Similar presentations


Presentation on theme: "Creating Custom Reports, Macros, and Switchboards"— Presentation transcript:

1 Creating Custom Reports, Macros, and Switchboards
Lab 6 Creating Custom Reports, Macros, and Switchboards Word 2002-Lab 1

2 Calculate group totals. Customize a report’s layout.
Objectives Group report records. Calculate group totals. Customize a report’s layout. Enhance a report’s appearance. Add a calculated control to a report. Create mailing labels. Create macros to automate database tasks. Use a switchboard to navigate a database. Secure a database with password protection. Word 2002-Lab 1

3 Concepts Grouping Records - Records in a report can be grouped into categories to allow you to better analyze the data. Group Calculations - If you group data in your report, you can perform group calculations on values, such as a group total, an average, a minimum value, and a maximum value. Macro - A macro automates common database tasks, such as opening and printing tables, forms, and reports. Switchboard - A switchboard is a form that contains command buttons for performing a variety of actions in a database, such as viewing forms and reports, running macros, opening other switchboards, and exiting the application. Word 2002-Lab 1

4 Creating a Grouped Report
Outline Creating a Grouped Report Planning the Report Running and Modifying the Associated Query Using the New Object Button to Create a Report Using the Report Wizard to Create a Grouped Report Displaying the Report

5 Customizing the report layout
Outline Customizing the report layout Resizing and Rearranging Controls Changing Text Alignment and Font and Fill Colors Working with Lines and Borders Adding a Page Header Changing the Record Source

6 Using calculated controls in a report
Outline Using calculated controls in a report Creating a Text Box Control Using the Expression Builder Changing Control Properties Printing a grouped report Creating Mailing Labels Using the Label Wizard Printing Mailing Labels

7 Using Macros Automating Repetitive Actions with a Macro
Outline Using Macros Automating Repetitive Actions with a Macro Copying and Editing Macros Creating a Print Macro

8 Using a Switchboard Securing a Database Lab Review
Outline Using a Switchboard Creating Switchboard Pages with the Switchboard Manager Adding and Editing Switchboard Items Adding Items to the Main Switchboard Using the Switchboard Form Automatically Displaying the Switchboard on Startup Securing a Database Lab Review

9 Creating a Grouped Report
Plan the report Create an associated query Use the new object button to create a report Some students might not be familiar with grouped reports Ask for or give examples of grouped reports Example: It might be useful for a store manager to group payroll records by department. Then, rather than getting a long list of pay for individual employees, the manager could get a report showing total payroll for each department Example: A mail-order company might group orders by date of purchase, then by item number to see detailed sales information These are special reports that group and summarize data in an organized and attractive manner Many reports are based on a query instead of a table This makes it easier to limit the data that you actually want in the query The Report Wizard is extremely useful in creating grouped reports Word 2002-Lab 1

10 Using the Report Wizard to Create a Grouped Report
In the above dialog box, you can select the fields on which you want to group the report Word 2002-Lab 1

11 Concept 1: GROUPING RECORDS
Group by category to better analyze data Access automatically groups records based on fields you choose Group by as many as 10 fields in one report Should be created based on priority from largest group to smallest Give examples of grouping records. Records in a report can be grouped by categories to allow you to better analyze the data Access can group records and calculate totals for the entire group. In Access you can create a report that will automatically group records based on fields you choose to group by. You can group by up to 10 fields in any one report. Groups should be created based on priority from the largest to the smallest Example: It might be useful for a store manager to group payroll records by department. Then, rather than getting a long list of pay for individual employees, the manager could get a report showing total payroll for each department Example: A mail-order company might group orders by date of purchase, then by item number to see detailed sales information Word 2002-Lab 1

12 Categories for Grouping
The above report will group the data first by location and then by job title within the location Word 2002-Lab 1

13 Concept 2: GROUP CALCULATIONS
The Wizard screen asks you to choose the type of calculation you want to use to summarize the grouped data on your report If you group data in your report, you can perform one or more of the following group calculations on values: Sum (adds all values by group) Avg (calculates the average value for the group) Min (calculates the lowest value for the group) Max (calculates the highest value for the group) Word 2002-Lab 1

14 Grouped Report The report displays a total and average for the gross pay field for each group Word 2002-Lab 1

15 Summary Calculations Group summary
The summary calculation in the above report includes summary information, a count value, and the total and average gross pay values Word 2002-Lab 1

16 Customizing the Report
Resize and rearrange controls Change text alignment Change font and fill colors Work with lines and borders Add page header Changes to the report is made in Design View Word 2002-Lab 1

17 Group Header & Footer Sections
Controls that display group identification information each time group changes Besides the standard Report Header, Page Header, Detail, Page Footer, and Report Footer sections, there are also sections called Location Header and Job Title Footer These are called Group Header and Footer sections They display group identification information on the report each time the group changes Word 2002-Lab 1

18 Controls rearranged and resized
Use Format/Size/To Fit to automatically resize the selected control to fit its contents Controls are compound objects, you need to select the control individually to apply font color changes to it Do not extend the line beyond the 6.5-inch ruler position or the report will be too wide to fit on a single page You will notice this problem if you see blank pages in your report when you preview or pint it Word 2002-Lab 1

19 Customized Report It is always a good idea to preview a report before printing it Word 2002-Lab 1

20 Changing the Record Source
Created report can be used again with other queries Change the Record Source control in the report to reference a different query If you like the report and want to use it again with different data, change the record source to reference a different query Make sure that when you change a control for the report, you have correctly selected the record Double click on the Report Selector (sometimes this box if difficult to see at first or Use New/Properties to open the Report Properties dialog box Word 2002-Lab 1

21 Using Calculated Controls in a Report
Create a text box control Open the Property dialog box Add a calculated control to the Control Source Use Expression Builder Format field Preview report A calculated control works the same way in a report as it does in a form — you enter an expression into it that calculates values from other controls in the report or its underlying table or query, or another report and it displays the results of that expression Word 2002-Lab 1

22 Control Source property
Calculated Control Control Source property You can type some or all of the calculation directly in the expression box, or build the calculation by selecting the appropriate operator buttons and/or expression elements, or use a combination of both methods New text box Word 2002-Lab 1

23 Printing a Grouped Report
Displays 2 pages Preview the report to see if any changes need to be made Word 2002-Lab 1

24 Creating Mailing Labels
Use Label Wizard Predefined labels or create custom ones Can specify font and text coloring Select desired fields Print labels The Report Wizard includes a Label Wizard that will create mailing labels Word 2002-Lab 1

25 Creating Mailing Labels
You can specify the type of label you want to create You can either use a predefined label or create a custom label Just as with other reports, you select the fields from the table to include in the labels Unlike other reports, however, as you select the fields, you also design the label layout in the Prototype Label box You may type any additional text, such as punctuation or a holiday message, directly onto the prototype Word 2002-Lab 1

26 Printing Mailing Labels
Three columns of mailing labels appear across the width of the page The placement of the labels on the page corresponds to the 5160 Avery labels you selected in this example using the Label Wizard The labels can be sorted by zip code or by another field Word 2002-Lab 1

27 Automates common database tasks
Concept 3: MACRO Automates common database tasks Opening & printing tables, forms , reports You enter a series of actions you want Access to perform Action – self-contained instructions Argument – provides additional information about action A macro automates common Access database tasks, such as opening and printing tables, forms, and reports It makes using your report easier Once a macro is created, you can run it from the Macros section of the database window You can also attach a macro to a command button on a form or create a custom menu command or toolbar button that will execute the macro. When a macro is run, Access starts at the beginning of the macro and performs all the specified actions in order until it reaches the end of the macro or, if the macro is part of a group of macros, the next macro in the group. Word 2002-Lab 1

28 Creating a Macro To create a macro, you enter a series of actions that you want Access to perform An action is a self contained instruction that can be combined with other actions to automate tasks You specify the arguments associated with the action Arguments provide additional information on how the action is to be carried out Word 2002-Lab 1

29 Saving a Macro Assign a name to the macro
As with other database objects, macros are saved with the database Word 2002-Lab 1

30 Copying & Editing Macros
Comment modified to reflect new view Change view to Print Preview You can use Copy and Paste to copy the first macro you created to create additional ones Change the actions and arguments to correspond with what you want this macro to do. Word 2002-Lab 1

31 Concept 4: SWITCHBOARD A form that contains command buttons for performing actions in a database Viewing forms and reports Running macros Opening other switchboards Exiting applications Switchboard Page Switchboard Manager Create a switchboard form to easily navigate through the database objects, selecting what function you want to perform A switchboard is like a menu Add items to select Restrict access to the tables so that records are only entered through the form Easy navigation of database When you create a Switchboard form with the Switchboard Manager, Access automatically creates a Switchboard Items table that describes what each button on the switchboard form does Each switchboard in a database is called a switchboard page You use the Switchboard Manager to create and modify switchboard pages When you first use the Switchboard Manager, Access automatically creates a Main Switchboard page You can put all the buttons for the database on this one page, or you can create individual switchboard pages that divide the buttons by category and then use the Main Switchboard to access these pages Word 2002-Lab 1

32 Switchboard Employees Pay Location Main Switchboard View Tables
View Forms View Reports Employees Pay Location Employee Update Mailing labels Gross pay Review the above layout with the students In your Lab exercise you will be creating 2 switchboard pages for the form and report macros Buttons for these will be added to the Main Switchboard Word 2002-Lab 1

33 Creating Switchboard Pages with the Switchboard Manager
Open the Switchboard Manager Choose Tools/Database Utilities/Switchboard Manager Main Switchboard page is created automatically Edit page to contain other pages Access initially creates a Main Switchboard page as the default Edit this switchboard to contain the buttons for the individual switchboard pages after you create them Word 2002-Lab 1

34 Creating a Switchboard
The new switchboard pages are displayed in the Switchboard Manager dialog box. Word 2002-Lab 1

35 Adding and Editing Switchboard Items
Adding an item to the Employee Form switchboard Word 2002-Lab 1

36 Reports Switchboard

37 Automatically Displaying Switchboard
You cab have the Main Switchboard page open automatically when the database is opened rather than the Database window open Access allows you to customize how a database looks and acts when opened, including what menus and toolbars are displayed, what window features are displayed, and how various features act. Word 2002-Lab 1

38 Exclusive protection Password protection Restricts access
Securing a Database Exclusive protection Restricts access Must be done each time file is opened Password protection Protects the database You can restrict access to the database by requiring that a password be entered in order to open the database You can also set the database to exclusive access to prevent others in a multiuser environment from opening the database while you are accessing it A multiuser database allows multiple users to access and modify the same database at the same time Word 2002-Lab 1

39 Setting to Exclusive Mode
Choose File/Open and select the database file From the Options on the drop-down menu, select Open Exclusive You need to set the database to Exclusive mode each time you open the file Word 2002-Lab 1

40 Key Terms Action - A self contained instruction that can be combined with other actions to automate tasks. Argument - Provides additional information on how a macro is to be carried out. Exclusive - Type of database that prevents others in a multiuser environment from opening the database while you are accessing it. Group - A way of organizing data on a common attribute. When data is grouped, calculations can be performed on all data in each group. Group Calculations - Reports grouped on one or more fields can have calculation based on these groups. Word 2002-Lab 1

41 Label Wizard - Used to create mailing labels.
Key Terms Group Header and Footer Sections - Section of Report Design that contains information on the groups. Label Wizard - Used to create mailing labels. Macro - Automates common Access database tasks, such as opening and printing tables, forms, and reports. Multiuser - Type of database that allows multiple users to access and modify the same database at the same time. Switchboard - Startup window that makes it easier to move from one task to another in a database.

42 Switchboard Manager - Used to create and modify switchboard pages.
Key Terms Switchboard Form - An Access form that contains command buttons for performing a variety of actions in a database, such as viewing forms and reports, running macros, opening other switchboards, and exiting the application. Switchboard Items Table - Describes what each button on the switchboard form does. Switchboard Manager - Used to create and modify switchboard pages. Switchboard Page - Each switchboard in a database.

43 Discussion Questions Discuss how grouping records in a report makes the report more meaningful. Discuss how group calculations can be used in a report. Give examples of the kinds of information that could benefit from summary data.

44 Discussion Questions Discuss how calculated controls can be used in a report. What types of calculations could you perform? Discuss how macros and switchboards can help automate database operations. Give examples of some operations that could be automated with these tools. Word 2002-Lab 1

45 Frequently Asked Questions
Is it necessary to create a report from a query? What is the purpose of grouping records? What summary values can I calculate when using the Report Wizard for creating groups? Are controls on forms and reports modified and formatted in the same way? Word 2002-Lab 1

46 Frequently Asked Questions
How do I create a calculated control in a report? I have a database and I need mailing labels. Do I have to use Word or does Access have a mailing label feature? What is a macro? When would I use a macro in Access? Word 2002-Lab 1

47 Frequently Asked Questions
What is an Access Switchboard? I want my switchboard to begin at startup. Is this possible? What type of data security does Access offer? Word 2002-Lab 1

48 Official MS Access Web Site http://www.mircosoft.com/access
Web Links Official MS Access Web Site Access Links Access Report Topics

49 Compact an Access Database
Web Links Compact an Access Database How to Create a Running Sum Query SSW: How to Improve Access Performance

50 Tony's Main MS Access Page http://www.granite.ab.ca/accsmstr.htm
Web Links Tony's Main MS Access Page Sample Databases from Microsoft Create Command Buttons for Access the Easy Way


Download ppt "Creating Custom Reports, Macros, and Switchboards"

Similar presentations


Ads by Google