Upload
clementine-hampton
View
218
Download
0
Tags:
Embed Size (px)
Citation preview
© 2005 ComputerPREP, Inc. All rights reserved.
Access 2003 Module II
© 2005 ComputerPREP, Inc. All rights reserved.
Lesson 1:Creating and Using Forms
Objectives
• Create forms using AutoForm
• Create forms using the Form Wizard
• Work with form controls
• Use error checking in forms and reports
• Add and delete controls
• Move and size controls
• Align and space controls
• Work with control properties
• Work with form properties
• Work with headers and footers
• Print forms
• Use forms to add records
• Sort records in Form view
Creating Forms Using AutoForm
• AutoForm automatically creates a form that displays all fields and records from a single table or query, using a predefined layout
• Five layout options are available with AutoForm:– Columnar– Tabular– Datasheet– PivotTable– PivotChart
Creating Forms Using AutoForm (cont’d)
• To create a form using AutoForm:– Click the New button in the database window
toolbar– In the New Form dialog box, select an AutoForm
layout option– Display the Choose The Table Or Query drop-
down list and then select the table or query on which the form will be based
Creating Forms Using the Form Wizard
• The Form Wizard presents a series of screens that prompt you for information about the form you want to create
• Using the Form Wizard, you can specify:
– The table or query to use
– The fields to include on the form
– A predefined form style
Working with Form Controls
• Control – a graphic object that displays in a form or report window
• Bound control – a control that displays data from the form’s underlying table or query
• Unbound control – a control that is not tied to fields in an underlying table or query
• Calculated control – a control that calculates values, such as totals or averages
• You can use the Toolbox to add controls to forms
Error Checking in Forms and Reports
• The error checking feature identifies common errors in forms and reports
• When an error is detected, an error indicator displays
• Click the error indicator to display the Error Checking Options button
• Click the Error Checking Options button to display an options menu
• To change error checking options or disable the feature, click Error Checking Options in the menu
Adding and Deleting Form Controls
• To add a bound control:
– Display the field list
– Drag a field from the field list into the appropriate section of the form
• To add an unbound control:
– Click the button in the Toolbox for the control you want to add
– Click or drag in the appropriate section of the form
• To delete a control:
– Select the control and its associated label (if applicable), then press DELETE
Moving and SizingForm Controls
• You can move a form control by:– Selecting the control and dragging a border to move
the control, or– Selecting the control and pressing the directional
keys, or– Specifying an exact location using control
properties• You can resize a control by:
– Selecting the control and dragging one of its sizing handles, or
– Using Size menu commands to size a control relative to other controls, or
– Specifying an exact size using control properties
Aligning and Spacing Form Controls
• You can align form controls by:– Moving them into position and using the rulers
in the Form Design window as a guide, or– Using alignment commands
• You can align controls by their top, bottom, left or right edges
• You can adjust spacing between controls by:– Using spacing commands
• You can evenly space controls or increase spacing between controls incrementally
Working with Control Properties
• Form controls have properties that you can modify using a properties sheet or the Formatting toolbar
• Control properties affect many aspects of forms including, but not limited to:– Size– Placement on the form– Text colors– Fonts and font sizes– Background colors– The text that displays in labels
Working with Form Properties
• Form properties control many aspects of a form including, but not limited to:– The record source for the form data– Whether the form window displays minimize or
maximize buttons, shortcuts or other window elements
– Whether existing records can be displayed and edited by the user
– Whether sections of the form are displayed in the form window
Working with Headersand Footers
Working with Headersand Footers (cont’d)
• When you create a form using AutoForm or the Form Wizard, the form header and footer are automatically included in the form design
• You can turn the display of form or page headers on or off as needed
Printing Forms• To print an entire form with all its records:
– Open the form in Form view– Click the Print button in the Form View toolbar, or– Right-click the form name in the object list, then
select Print• To print a single record:
– Display the form in Datasheet view– Click the appropriate record indicator, then select
File | Print• To print consecutive records:
– Display the form in Datasheet view– Select consecutive records and then select
File | Print
Using Forms to Add Records
• When you use a form to add records, the data is added to the underlying table or query
• To help ensure accurate data entry, you can use form properties to display only one record at a time or to display only blank forms for new data entry
Sorting Records in Form View
• In Form view, you can sort records by only one field at a time
• To sort records in Form view:– Click the text box of the field by which you want
to sort– Click the Sort Ascending or Sort Descending
button in the Form View toolbar
© 2005 ComputerPREP, Inc. All rights reserved.
Lesson 2:Using Subforms
Objectives
• Create subforms• Use the Subform Wizard• Use the drag-and-drop technique to create
subforms• Display information with subforms• Change the subform view• Change the subform layout• Use subforms to add table records
Creating Subforms
• Subform – a form embedded within another form• Subforms display data from tables or queries that
have a one-to-many relationship with the record displayed in the main form– The main form displays data from the table on
the “one” side of the relationship– The subform displays data from the table on the
“many” side of the relationship
Creating Subforms (cont’d)
• The main form and subform are inked by the foreign key field, which allows the subform to display only records that relate to the record currently displayed in the main form
Creating Subforms (cont’d)
• A form can have any number of subforms• You can nest up to seven levels of subforms• You can specify more than one table as the record
source for a form or subform• Create subforms by:
– Using the Form Wizard as you create a new form
– Using the SubForm Wizard– Using the Subform/Subreport button in the
Toolbox– Using the drag-and-drop technique
Using the SubForm Wizard
• Access automatically links the main form and the subform if the linking fields have the same kind of data, data type or field size
• The linking fields do not have to appear in the main form or subform
Creating Subforms UsingDrag-and-Drop
• To use the drag-and-drop technique, both the main form and the form to be used as the subform must already exist in the Forms object list
• To create a subform:– Open the main form– Position the form window and the database
window so both are visible– Drag the form to be used as the subform into
the bottom portion of the main form
Displaying Informationwith Subforms
• You can display a subform as a:– Datasheet – displays multiple records as a
datasheet (one row per record)– Single form – displays one record in a form– Continuous form – displays multiple records in
a form• A main form can only be displayed as a single
form
Changing the SubformView and Layout
• You can use the View | Subform command to switch between Form and Datasheet views
• In Form view, you can change the layout by:– Changing column widths– Changing column order– Changing row height– Hiding or displaying columns– Freezing columns
• To change the size of a subform, display the main form in Design view
Using Subforms to AddTable Records
• When you enter data into the main form:– The data is automatically saved to the primary
table as you move to the subform• When you enter data into the subform:
– The data is automatically saved to the foreign table as you add the new record
© 2005 ComputerPREP, Inc. All rights reserved.
Lesson 3:Using Advanced Form Features
Objectives
• Create forms in Form Design view• Use calculated controls• Add an unbound control• Understand the syntax of an expression• Create an expression manually• Create an expression using the Expression Builder• Improve data entry accuracy• Use shortcut keys• Set the tab order
Creating Forms in Design View
• To create a form in Design view:– Display the New Form dialog box– Specify Design View and the table from which
the underlying data will be derived– Drag the fields from the table’s field list onto
the form– Rearrange the controls on the form for an
appealing look
Using Calculated Controls
• To create a calculated control:– Insert an unbound text box control into a form– Display the Data properties for the unbound text
box control– Type an expression in the Control Source text
box, or– Use the Expression Builder to build an
expression in the Control Source text box
Understanding the Syntaxof an Expression
• Use an identifier to refer to an object or its properties
• The identifiers Forms and Reports refer to the open forms or reports in the database
• The ! operator indicates that the object that follows is a user-defined object
• Examples:– Forms![Vehicles2] refers to the Vehicles2 form– Forms![Vehicles2]![Cost] refers to the Cost field
in the Vehicles2 form
Creating an Expression Manually
• To create an expression manually, type an expression directly in the Control Source text box in the properties sheet for the unbound control
Using the Expression Builder
Improving Data Entry Accuracy in Forms
• Use the built-in shortcut key CTRL+’ to insert the value from a field in one record into the same field in the next record
• Set the tab order so that the cursor moves from field to field in an orderly manner as you add data to a form
• Exclude controls from the tab order for controls that should not be used in data entry, such as calculated controls
Setting the Tab Order
• Use the Tab Order dialog box to set the tab order
• Click the Auto Order button to create a left-to-right, top-to-bottom order
• To exclude a control from the tab order, display its properties sheet, then change the value in the Tab Stop text box to No
© 2005 ComputerPREP, Inc. All rights reserved.
Lesson 4:Creating and Using Reports
Objectives
• Create reports using AutoReport• Create reports using the Report Wizard• Define and describe report sections• Work with report controls• Add and delete controls• Add a calculated control to a report• Move, size, align and space controls
Creating Reports Using AutoReport
• AutoReport automatically generates a report that displays all fields and records from a single table or query
• Two layout options are available with AutoReport:– Columnar – displays the data for each record
vertically– Tabular – displays the data for each record
horizontally
Creating Reports Using the Report Wizard
• The Report Wizard presents a series of screens that prompt you for information about the report you want to create
• Using the Report Wizard, you can specify:– The table or query to use (you can specify more
than one if working with related tables)– The fields to include on the report– Grouping and sorting options– A report style– A report title
Examining Report Sections
Reports have several distinct sections
Adding and Deleting Report Controls
To add a control:
• Drag a field from the field list into the appropriate section of the report, or
• Click the button in the Toolbox for the control you want to add, then click or drag in the appropriate section of the report
To delete a control:• Select the control and its associated label (if
applicable), then press DELETE
– If the control is a text box control, any record data associated with the control is also deleted
Adding a Calculated Control to a Report
• To add a calculated control to a report, add an unbound text box control, then add an expression to define the calculation
• Type the expression directly, or use the Expression Builder dialog box to establish an expression
Moving, Sizing, Aligning and Spacing Report Controls
To move a report control within a report section:
• Select the control and drag a border to move the control, or
• Select the control and press the directional keys
To move a report control from one section to another:
• Use the Cut and Paste commands
To size a report control:
• Select the control and drag one of its sizing handles, or
• Use Size menu commands to size a control relative to other controls
Moving, Sizing, Aligning and Spacing Report Controls (cont’d)
To align report controls:• Move them into position and use the rulers in the
Report Design window as a guide, or• Use alignment commands
– You can align controls by their top, bottom, left or right edges
To adjust spacing between controls:• Use Spacing commands
– You can evenly space controls or increase spacing between controls incrementally
© 2005 ComputerPREP, Inc. All rights reserved.
Lesson 5:Using AdvancedReport Features
Objectives
• Work with report control and section properties• Group and sort records in reports• Change report properties• Print reports• Create reports in Design view• Customize headers and footers• Force pagination• Concatenate text fields• Work with subreports
Working with Report Control and Section Properties
• Every report control has properties you can modify by using a properties sheet or the Formatting toolbar
• Report sections also have properties that can be modified using a properties sheet
• Common modifications to section properties include:– Forcing pagination– Repeating sections when grouped data spans
multiple pages
Grouping and Sorting Records in Reports
• When using the Report Wizard, you can specify grouping and sorting options as part of the wizard process
• You can also specify grouping and sorting options after a report is generated by using the Sorting And Grouping dialog box
Grouping and Sorting Records in Reports (cont’d)
• When grouping options are specified, Access adds a Group Header and/or Group Footer section to the report design
• To specify sorting and grouping options:– Select a field from the Field/Expression
drop-down list– Specify Yes in either the Group Header or
Group Footer text box to specify grouping– Specify No in both text boxes to specify sorting– Use the Sort Order column to specify sort order
Changing Report Properties
• Reports have properties that determine how they display and print data
• Report properties include, but are not limited to:– Caption property – used to control what
displays in labels or in the title bar of the Print Preview window
– Record Source property – used to specify the table or query used as the underlying source for bound controls in the report
Printing Reports
• Use Print Preview to see how a report will look when printed
• Use Layout Preview to view a portion of the report• To print an entire report, display the report in Print
Preview, then click the Print button• To print specific pages of a report, select
File | Print and use the Print dialog box to specify the pages you want to print
Printing Reports (cont’d)
• To change margins for printing, display the Margins tab of the Page Setup dialog box and specify margin settings
• To change page orientation for printing, display the Page tab of the Page Setup dialog box and select either Portrait or Landscape
Creating Reports inDesign View
• To create a report in Design view:– Display the New Report dialog box– Specify Design View and the table from which
the underlying data will be derived– Drag the fields from the table’s field list onto
the report– Rearrange and resize the controls on the report
for an appealing look
Customizing Headersand Footers
• Customize header and footer sections by:– Adding bound, unbound and calculated
controls– Opening, closing and resizing report sections– Adding page numbers and time and date
stamps• Both are found on the Insert menu in report
Design view
Forcing Pagination
• Using page breaks:– In report Design view, click the Page Break
button in the Toolbox– Click in the desired report section
• Using the Force New Page property:– In report Design view, display the All properties
for the section– In the Force New Page text box, select a
property setting from the drop-down list
Concatenating Text Fields
• Concatenating text fields combines values from multiple fields and displays it as a continuous text string
• Concatenated fields:– Occupy less room in a report– Are generally easier to read than separate fields
• Use the ampersand (&) operator in an expression to concatenate values from text fields
Working with Subreports
• Subreport - a report that is inserted into another report, called the main report
• The subreport control must be linked to the main report in order for the report to be synchronized
• Use the Subreport Field Linker dialog box to link reports that are not automatically linked because:– The tables/queries are not part of a defined
relationship– The main report is not based on a primary
table/query and the subreport is not based on a foreign table/query
© 2005 ComputerPREP, Inc. All rights reserved.
Lesson 6:Enhancing Forms and Reports
Objectives
• Use AutoFormat• Change the appearance of forms and reports• Apply special effects• Apply colors to forms and reports• Format form sections• Add graphics
Using AutoFormat• AutoFormat – a feature that formats a form or
report with a predefined format and layout• When you use AutoReport or AutoForm, the most
recently used style is applied to the report or form• Use the AutoFormat feature to change a report or
form style after the report or form has been generated
• To use AutoFormat:– Display the report or form in Design view– Click the AutoFormat toolbar button– Select a format in the AutoFormat dialog box
Changing the Appearance of Forms and Reports
• You can customize a form or report by applying special effects and other formatting
• Special effects change the appearance of controlsSpecial effects include:– Flat– Raised– Sunken– Shadowed– Chiseled– Etched
Changing the Appearance of Forms and Reports (cont’d)
• You can also apply colors to forms and reports
You can apply color to:– Text– Controls– Backgrounds
Formatting Form Sections
• When you create a form using AutoForm or the form Wizard, the Form Header and Form Footer sections are created, but remain closed and empty
• You can expand the Form Header and Form Footer section and add controls, lines, graphics, and colors to modify the appearance of the form
• You cannot change form section background colors when using a format other than the Standard format
Adding Graphics
• You can add graphics to forms and reports, including lines and shapes, clipart, image files created in other programs, and Microsoft Excel charts or graphs
To add a line or a box:
– Click the Line tool or Rectangle tool in the Toolbox, then click and drag in the Design window
To add an image:
– Click the Image tool in the Toolbox, click and drag in the Design window, navigate to the location of the image, then double-click the file name
© 2005 ComputerPREP, Inc. All rights reserved.
Lesson 7:Using Data Access Pages
Objectives
• Save forms and reports as data access pages• Use the Page Wizard• Create data access pages in Design view• Save PivotTables and PivotCharts as data access
pages
Saving Forms and Reports as Data Access Pages
• Data access page – a Web page, published from Access, that has a connection to database contents
• Data access pages allow others to view and work with data from an Access database via the Internet or an intranet
• You can use data access pages for reporting, data entry and data analysis
Saving Forms and Reports as Data Access Pages (cont’d)
• Four ways to create data access pages while a database is open:– Use AutoPage– Use the Page Wizard– Create a new page in Page Design view– Convert an existing Web page into a data
access page
Saving Forms asData Access Pages
• To save a form as a data access page, display the Save As dialog box and select Data Access Page as the file type
• If a form is based on a table with a primary key assigned, the data access page can be used to view, add to, edit and manipulate data
• If a form is based on a query, you can use the data access page based on the form to view and manipulate data, but not to add or edit data
Saving Reports asData Access Pages
• Data access pages created from reports can only be viewed; they cannot be used to add, edit or manipulate data
• A report must be displayed in Report Design view to be saved as a data access page
Using the Page Wizard
• Use the Page Wizard to create a data access page based on one or more tables or queries
• The Page Wizard prompts you for information about the record source(s), layout and format, then creates a page based on your responses
Creating Data Access Pages in Design View
• You can use the New Data Access Page dialog box to specify that you will create a page in Design view and to specify the record source to be used
• Select fields in the Field List, then click the Add To Page button to add the fields to the data access page
Creating Data Access Pagesin Design View (cont’d)
• Use the Layout Wizard dialog box to specify a layout for the page
Saving PivotTables and PivotCharts as Data Access Pages
• PivotTable – a view that groups and summarizes field values from a table, query or form in a tabular format
• PivotChart – a view that groups and summarizes field values from a table, query or form in a graphical format
• Users can move fields to different areas of the PivotTable or PivotChart to create different group or summary formats
Saving PivotTables asData Access Pages
To create a PivotTable:
• Display the object in PivotTable view
• Drag fields from the PivotTable Field List to the Drop Totals or Detail fields Here section of the PivotTable to display detail records from the record source
• Drag fields to the Drop Row Fields Here and Drop Column Fields Here sections to specify the fields by which to summarize and group data
• Drag a field to the Drop Filter Fields Here section to specify the field by which to display only particular data
Saving PivotTables asData Access Pages (cont’d)
• To save a PivotTable as a data access page:– Select File | Save As to display the Save As
dialog box– Type a name for the page– Display the Save As drop-down list, then select
Data Access Page
Saving PivotCharts asData Access Pages
To create a PivotChart:• Drag fields from the Chart Field List to the Drop
Category Fields Here or Drop Series Fields Here sections of the PivotChart to display the data series in the chart
• Drag fields to the Drop Data Fields Here section to specify the values to be summarized in the chart
• Drag a field to the Drop Filter Fields Here section to specify the field by which to display particular data
Saving PivotCharts asData Access Pages (cont’d)
• To save a PivotChart as a data access page:– Select File | Save As to display the Save As
dialog box– Type a name for the page– Display the Save As drop-down list, then select
Data Access Page
© 2005 ComputerPREP, Inc. All rights reserved.
Lesson 8:Managing Databases
Objectives
• Work with object dependencies• Identify object dependencies• Modify object dependencies• Compact and repair databases• Back up databases
Working with Object Dependencies
• Viewing object dependencies helps you avoid creating errors when you delete objects
• After you identify object dependencies you can modify the dependent objects to eliminate the dependencies or delete the dependent objects
Identifying Object Dependencies
• To view dependencies for an object, select the object in the object list and display the Object Dependencies task pane
• Access uses information maintained by theName AutoCorrect feature to generate object dependency information
• Dependency information is available only for tables, queries, forms and reports
• For nested queries, only the highest-level query is supported
Modifying Object Dependencies
• You can modify object dependencies to remove the dependencies or delete the dependent object
• When tables are dependent objects, you can remove the dependencies by deleting the relationships between the tables
• When the dependent objects are queries or forms, modifying the dependencies might entail removing a field from the object design or deriving the same information from another source, if available
Compacting and Repairing Databases
• When you compact a database, Access recovers disk space by writing data to adjacent disk sectors
• The compact and repair processes are combined into a single database utility
• Three methods to compact databases:– Compact the current database– Compact a database that is not open– Compact a database automatically each time it
is closed
Backing Up Databases
To back up a database:• Open the database• Select File | Back Up
Database to display the Save Backup As dialog box
• Specify a name and location for the backup file
• Click the Save button
© 2005 ComputerPREP, Inc. All rights reserved.
Lesson 9:Importing and Exporting Data
Objectives
• Import data into tables• Import data into new tables• Append imported data to existing tables• Export data to other Office 2003 applications• Work with XML documents• Export Access data as XML documents
Importing Data into Tables• Imported data can be appended to the end of an
existing table or imported into a new table
• If importing from an Excel worksheet:
– The data must be arranged in an appropriate tabular format
– The worksheet must have the same type of data in each corresponding field
– The worksheet must have the same fields in every row
– If appending data to a table, the worksheet column headings must match the table field names
Importing Data intoNew Tables
• When importing data into an Access database, Access will attempt to assign the appropriate data types to the imported fields
• You should verify data types and field properties, and modify them if necessary
• Use the Import Spreadsheet Wizard to import Excel worksheet data
Appending Imported Datato Existing Tables
• When you import data into an existing table, the data is appended to the end of the table
• If a primary key is assigned, the new records are sorted by the primary key field
• When using Excel data, the worksheet column headings must match the table’s field names
Exporting Data to Other Office 2003 Applications
• Use the File | Export command to export Access table data to other Office 2003 applications
• When you export table data to an Excel workbook:– Formats and input masks are not carried over
with the data– Fields with the Yes/No data type are
represented in the worksheet with the values True/False
Working with XML Documents
• XML (Extensible Markup Language) – the standard language for describing and delivering data on the Web
• Schema – a file used to describe the structure of the data in an XML file
• Transform – a file that describes how XML data should be displayed
• ReportML – a markup language developed by Microsoft and used to support XML in Access 2003
Exporting Access Data asXML Documents
• You can export tables, queries, forms and reports to an XML file
• Use the Export XML dialog box to export Access data as XML