microsoft access 2010 chapter 9 macros, navigation forms, pivottables, and pivotcharts
TRANSCRIPT
MicrosoftAccess 2010
Chapter 9
Macros, Navigation Forms, PivotTables, and
PivotCharts
Macros, Navigation Forms, PivotTables, and PivotCharts 2
• Create and modify macros and submacros• Create a menu form with command buttons• Create a menu form with option groups• Create datasheet forms and user interface (UI)
macros• Create navigation forms
Objectives
Macros, Navigation Forms, PivotTables, and PivotCharts 3
• Create data macros• Create a PivotTable• Change properties in a PivotTable• Use a PivotTable• Create a PivotChart and add a legend• Change properties in a PivotChart• Use a PivotChart
Objectives
Macros, Navigation Forms, PivotTables, and PivotCharts 4
Project – Macros, Navigation Forms, PivotTables, and PivotCharts
Macros, Navigation Forms, PivotTables, and PivotCharts 5
Project – Macros, Navigation Forms, PivotTables, and PivotCharts
Macros, Navigation Forms, PivotTables, and PivotCharts 6
Project – Macros, Navigation Forms, PivotTables, and PivotCharts
Macros, Navigation Forms, PivotTables, and PivotCharts 7
Project – Macros, Navigation Forms, PivotTables, and PivotCharts
Macros, Navigation Forms, PivotTables, and PivotCharts 8
• Determine when it would be beneficial to automate tasks in a macro
• Determine whether it is appropriate to create a navigation form
• Determine the organization of the navigation form• Determine whether it is appropriate to present data as a
PivotTable• Determine the organization of the PivotTable• Determine whether it is appropriate to present data as a
PivotChart• Determine the organization of the PivotChart
General Project Guidelines
Macros, Navigation Forms, PivotTables, and PivotCharts 9
• Click the Macro button (Create tab | Macros & Code group) to create a new macro
Begin Creating a Macro
Macros, Navigation Forms, PivotTables, and PivotCharts 10
• Double-click the Submacro element from the Program Flow section of the Action Catalog to add a submacro and then type the desired submacro name
• Click the expand indicator for the Database Objects category of actions to display the actions within the category
• Double-click the desired action to add it to the submacro• Change the arguments as desired• Click the Save button on the Quick Access Toolbar, type the
desired macro name, and then click the OK button to save the macro
Adding an Action to a Macro
Macros, Navigation Forms, PivotTables, and PivotCharts 11
Adding an Action to a Macro
Macros, Navigation Forms, PivotTables, and PivotCharts 12
• Click the Form Design button (Create tab | Forms group) to create a blank form in Design view
• If a field list appears, click the Add Existing Fields button (Form Design Tools Design tab | Tools group) to remove the field list
• Save the form with the desired name• Make sure the Use Control Wizards button is selected• Click the Button tool (Form Design Tools Design tab | Controls
group) and then click the desired position to display the Command Button Wizard dialog box
• Click Miscellaneous in the Categories box, and then click Run Macro in the Actions box
Creating a Menu Form Containing Command Buttons
Macros, Navigation Forms, PivotTables, and PivotCharts 13
• Click the Next button to display the next screen in the wizard
• Click the desired macro to run• Click the Next button to display the next Command
Button Wizard screen• Click the Text option button• Type the desired text to appear on the button• Click the Next button• Click the desired button name• Click the Finish button to finish specifying the button
Creating a Menu Form Containing Command Buttons
Macros, Navigation Forms, PivotTables, and PivotCharts 14
Creating a Menu Form Containing Command Buttons
Macros, Navigation Forms, PivotTables, and PivotCharts 15
• Click the Form Design button (Create tab | Forms group) to create a blank form in Design view
• If a field list appears, click the Add Existing Fields button (Form Design Tools Design tab | Tools group) to remove the field list
• Save the form using the desired name• Click the More button (Form Design Tools Design tab |
Controls group) to display the gallery of available tools• With the Use Control Wizards button selected, click the
Option Group tool (Form Design Tools Design tab | Controls group) and then click the desired location to start the Option Group Wizard
Creating a Menu Form Containing an Option Group
Macros, Navigation Forms, PivotTables, and PivotCharts 16
• Type the name for each label in its own row, pressing the DOWN ARROW after each label name
• Click the Next button to move to the next Option Group Wizard screen
• Click the ‘No, I don’t want a default’ option button to select it
• Click the Next button to move to the next Option Group Wizard screen and then verify that the values assigned to the labels
Creating a Menu Form Containing an Option Group
Macros, Navigation Forms, PivotTables, and PivotCharts 17
• Click the Next button to move to the next Option Group Wizard screen, and then select the desired style
• Click the Next button to move to the next Option Group Wizard screen and then type the desired caption
• Click the Finish button to complete the addition of the option group
Creating a Menu Form Containing an Option Group
Macros, Navigation Forms, PivotTables, and PivotCharts 18
Creating a Menu Form Containing an Option Group
Macros, Navigation Forms, PivotTables, and PivotCharts 19
Using an If Statement
Macros, Navigation Forms, PivotTables, and PivotCharts 20
• With the option group selected, display a property sheet
• If necessary, click the All tab• Click the After Update property• Click the Build button to display the Choose
Builder dialog box• With Macro Builder selected in the Choose
Builder dialog box, click the OK button to create a macro
Creating a Macro for an Option Group
Macros, Navigation Forms, PivotTables, and PivotCharts 21
• If necessary, click the Action Catalog button (Macro Tools Design tab | Show/Hide group) to display the Action Catalog
• Expand the desired category• Double-click the desired action to add the action
to the macro• Type the desired Name argument and Expression
argument
Creating a Macro for an Option Group
Macros, Navigation Forms, PivotTables, and PivotCharts 22
Creating a Macro for an Option Group
Macros, Navigation Forms, PivotTables, and PivotCharts 23
• Double-click the element from the desired section of the action catalog
Adding Actions to a Macro
Macros, Navigation Forms, PivotTables, and PivotCharts 24
Adding Actions to a Macro
Macros, Navigation Forms, PivotTables, and PivotCharts 25
• Open the desired table• Display the Create tab and then click the More
Forms button (Create tab | Forms group) to display the More Forms menu
• Click Datasheet to create a datasheet form• Save the form using the desired name• Click the desired heading in the datasheet Display
the property sheet• Click the Event tab to display only event properties
Creating Datasheet Forms that Incorporate UI Macros
Macros, Navigation Forms, PivotTables, and PivotCharts 26
• Click the desired event and then click the Build button to display the Choose Builder dialog box
• Add the desired action(s) to the macro
Creating Datasheet Forms that Incorporate UI Macros
Macros, Navigation Forms, PivotTables, and PivotCharts 27
• Click the Create tab and then click the Navigation button (Create tab | Forms group) to display the menu of available navigation forms
• Click Horizontal Tabs in the menu to create a form with a navigation control in which the tabs are arranged horizontally in a single row
• If a field list appears, click the Add Existing Fields button (Form Layout Tools Design tab | Tools group) to remove the field list
• Save the form using the desired name• Click the form title twice: once to select it and the second time to
produce an insertion point• Type the desired title, and then save the form
Creating a Navigation Form
Macros, Navigation Forms, PivotTables, and PivotCharts 28
Creating a Navigation Form
Macros, Navigation Forms, PivotTables, and PivotCharts 29
• Drag the form to the [Add New] placeholder to add a new tab
• Two rename a tab, click the tab to rename twice: one to select it and the second time to produce an insertion point
• Change the tab name as desired
Adding Tabs to a Navigation Form
Macros, Navigation Forms, PivotTables, and PivotCharts 30
Adding Tabs to a Navigation Form
Macros, Navigation Forms, PivotTables, and PivotCharts 31
Creating a Date Macro
Macros, Navigation Forms, PivotTables, and PivotCharts 32
PivotTables
Macros, Navigation Forms, PivotTables, and PivotCharts 33
PivotTables
Macros, Navigation Forms, PivotTables, and PivotCharts 34
• Open the Navigation Pane, right-click the desired query, click Open on the shortcut menu, and then close the Navigation Pane
• Click the View button arrow to display the View button menu• Click PivotTable View to switch to the PivotTable view of the
query• If the PivotTable Field List does not appear, click the Field List
button (PivotTable Tools Design tab | Show/ Hide group) to display the field list
• Click the field to add to the row area, and ensure Row Area appears next to the Add to button
Creating a PivotTable
Macros, Navigation Forms, PivotTables, and PivotCharts 35
• Click the Add to button to add the selected field to the row area
• Click the Add to box arrow to display a list of available areas
• Click Column Area, click the field in the field list to add to the column area, and then click the Add button
• Click the Add to box arrow, click Data Area, click the field to add to the data area, and then click the Add to button
• Close the PivotTable Field List by clicking Field List button (PivotTable Tools Design tab | Show/Hide group)
Creating a PivotTable
Macros, Navigation Forms, PivotTables, and PivotCharts 36
Creating a PivotTable
Macros, Navigation Forms, PivotTables, and PivotCharts 37
• Click the desired column heading, and then click the Property Sheet button (PivotTable Tools Design tab | Tools group) to display a property sheet
• Click the Captions tab in the property sheet• Delete the current entry, and then type the
desired caption
Changing Properties in a PivotTable
Macros, Navigation Forms, PivotTables, and PivotCharts 38
Changing Properties in a PivotTable
Macros, Navigation Forms, PivotTables, and PivotCharts 39
Using a PivotTable
Macros, Navigation Forms, PivotTables, and PivotCharts 40
Using a PivotTable
Macros, Navigation Forms, PivotTables, and PivotCharts 41
PivotCharts
Macros, Navigation Forms, PivotTables, and PivotCharts 42
PivotCharts
Macros, Navigation Forms, PivotTables, and PivotCharts 43
• Open the query from which to create a PivotChart• Click the View button arrow, and then click
PivotChart View• If the Chart Field List appears, close the field list
by clicking the Field List button (PivotChart Tools Design tab | Show/Hide group)
• Click the Legend button (PivotChart Tools Design tab | Show/Hide group) to display a legend
Creating a PivotChart and Adding a Legend
Macros, Navigation Forms, PivotTables, and PivotCharts 44
Creating a PivotChart and Adding a Legend
Macros, Navigation Forms, PivotTables, and PivotCharts 45
• If the Change Chart Type button is dimmed, click the Chartspace
• Click the Change Chart Type button (PivotChart Tools Design tab | Type group), and then, if necessary, click the Type tab to display the available chart types
• Click the desired chart category and chart type
Changing the Chart Type
Macros, Navigation Forms, PivotTables, and PivotCharts 46
Changing the Chart Type
Macros, Navigation Forms, PivotTables, and PivotCharts 47
• Click the Switch Row/Column button (PivotChart Tools Design tab | Active Field group) to change the organization
Changing the PivotChart Orientation
Macros, Navigation Forms, PivotTables, and PivotCharts 48
• Click the desired axis title, and then display the property sheet
• Click the Format tab in the Properties window, and then click the Caption box
• Type the new caption
Assigning Axis Titles
Macros, Navigation Forms, PivotTables, and PivotCharts 49
Assigning Axis Titles
Macros, Navigation Forms, PivotTables, and PivotCharts 50
• Click the Drop Zones button (PivotChart Tools Design tab | Show/Hide group) to remove the drop zones
Removing Drop Areas
Macros, Navigation Forms, PivotTables, and PivotCharts 51
• Click anywhere in the Chartspace of the PivotChart, display the property sheet, and then, if necessary, click the General tab
• Click the Add Title button• Close the property sheet, click the newly added
title, and then display the property sheet• Click the Format tab• Click the Caption box, type the desired caption,
and then press the ENTER key
Adding a Chart Title
Macros, Navigation Forms, PivotTables, and PivotCharts 52
Adding a Chart Title
Macros, Navigation Forms, PivotTables, and PivotCharts 53
Using a PivotChart
Macros, Navigation Forms, PivotTables, and PivotCharts 54
Using a PivotChart
Macros, Navigation Forms, PivotTables, and PivotCharts 55
• Create and modify macros and submacros• Create a menu form with command buttons• Create a menu form with option groups• Create datasheet forms and user interface (UI)
macros• Create navigation forms
Chapter Summary
Macros, Navigation Forms, PivotTables, and PivotCharts 56
• Create data macros• Create a PivotTable• Change properties in a PivotTable• Use a PivotTable• Create a PivotChart and add a legend• Change properties in a PivotChart• Use a PivotChart
Chapter Summary
Chapter 9 Complete
MicrosoftAccess 2010