microsoft office access 2003

31
New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5 1 XP Microsoft Office Access 2003 Tutorial 5 – Enhancing a Table’s Design and Creating Advanced Queries

Upload: ryo

Post on 25-Feb-2016

37 views

Category:

Documents


2 download

DESCRIPTION

Microsoft Office Access 2003. Tutorial 5 – Enhancing a Table’s Design and Creating Advanced Queries. Create a Lookup Wizard field in a table. To make a form easier to use, you will often add a Lookup Wizard to the form. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

1

XP

Microsoft Office Access 2003

Tutorial 5 – Enhancing a Table’s Design and Creating Advanced Queries

Page 2: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

2

XPCreate a Lookup Wizard field in a table

• To make a form easier to use, you will often add a Lookup Wizard to the form.

• Instead of remembering a particular value, you can pick the value from a list.

• This approach insures that you cannot enter an invalid value.

• When you create the Lookup Wizard, you will provide a list of acceptable values from which other users will make a selection.

Page 3: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

3

XPStart the Lookup Wizard process

• To start the Lookup Wizard process:– Start Access and open the database to be modified– Open the desired table in Design view– Find the field you want to modify as a Lookup Wizard– Click on the right side of the Data Type text box for the

field, and then click the Lookup Wizard option– The first Lookup Wizard dialog box will appear

Page 4: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

4

XPLookup Wizard dialog box 1

Page 5: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

5

XPLookup Wizard dialog box 2

Page 6: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

6

XPLookup Wizard dialog box 3

Page 7: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

7

XPA lookup field in Datasheet view

Page 8: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

8

XPDisplay related table records in a subdatasheet

• You can form a relationship between two tables based on a common field.

• You can display the data from the related table as a subdatasheet in the primary table's datasheet.

• To see the subdatasheet, simply click the expand indicator in the row for which you'd like to see the subdatasheet.

Page 9: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

9

XPIllustration of a subdatasheet

Page 10: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

10

XPCreate an input mask for a table field

• Some fields require special characters to make them more readable. A phone number, for example, often includes parentheses and/or dashes. You can create an input mask that will display these characters as a predefined format.

• This predefined format can be used to enter or display data in a field.

• You can set up literal display characters that will automatically appear in a field. When you provide literal display characters, the user will not need to enter those characters.

• The Input Mask Wizard makes it easy for you to create an input mask.

Page 11: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

11

XPAn input mask for a phone number field

Page 12: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

12

XPInput Mask character descriptions

Page 13: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

13

XPDefine data validation criteria

• You may want to view only records that match a particular criteria. You can do this by creating a query that uses a pattern match.

• You can use the like comparison operator using the asterisk (*), the question mark (?), or the number symbol(#). These wildcard characters allow you to create much more flexible patterns.

• You can also create a List of values match by creating a list of valid values and then using the In comparison operator to define a condition with two or more values. The non-matching values select records that do not match the criteria specified.

Page 14: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

14

XPA design grid with a pattern match field

Page 15: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

15

XPUse a list of values to expand the selection possibilities

Page 16: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

16

XPUse both the And and Or logical operators in the same query

• There will be circumstances where you will want to use both the And and Or logical operators in the same query.

• The In operator naturally creates an Or condition. You can also use the key word Or in the criteria row to create an Or condition.

• Placing two conditions on the same row of the Criteria in the Query design grid creates an And condition.

• Placing two conditions on separate rows in the Query design grid creates an Or condition.

Page 17: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

17

XPSample design grid with And and Or conditions in the same query

Page 18: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

18

XPThe query result for the combined use of And and Or

Page 19: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

19

XPCreate a parameter query

• Sometimes when you create a query, you don't know exactly which records the user might want to see.

• To allow flexibility in the query, you can create a parameter query.

• The parameter query will prompt the user to enter the value they want to use to select records.

• Once the user has supplied this information, those records that match the value will be displayed in the query datasheet.

Page 20: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

20

XPDefining a parameter query

Page 21: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

21

XPCreating a Crosstab Query

• A crosstab query performs aggregate function calculations on the values of one database field and displays the results in a spreadsheet format.

• An aggregate function performs an arithmetic operation on selected records in a database.

• To access the crosstab query wizard, create a new query and select the Crosstab Query Wizard option from the New Query dialog box.

Page 22: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

22

XPAggregate Functions

Page 23: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

23

XPThe Crosstab Query Wizard dialog box 1

Page 24: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

24

XPThe Crosstab Query Wizard dialog box 2

Page 25: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

25

XPThe Crosstab query recordset

Page 26: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

26

XPThe Find Duplicates Query

• The find duplicates query finds duplicate records in a table or query.

• Locating duplicates helps avert potential problems (assigning two different product numbers to the same product).

• To create a Find Duplicates Query, select the Find Duplicates Query Wizard in the New Query dialog box when you create a new query.

Page 27: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

27

XPThe Find Duplicates Query

Page 28: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

28

XPThe Find Unmatched Query

• A find unmatched query is a select query that finds all records in a table or query that have no related records in a second table or query.

• You can, for example, find all customers who have not placed an order.

• To create a Find Unmatched Query, select the Find Unmatched Query Wizard in the New Query dialog box when you create a new query.

Page 29: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

29

XPThe Find Unmatched Query dialog box

Page 30: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

30

XPThe Top Values Query

• This query allows you to limit the number of records that display as a result of a query.– Top Values property

• Create a query in design view with the necessary fields and sorting. Enter the number of records (or percentage of records) you want selected in the Top Values text box on the Query Design toolbar and then click the Run button.

Page 31: Microsoft Office Access 2003

New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 5

31

XPThe Top Values Query