Presentation is loading. Please wait.

Presentation is loading. Please wait.

XP 1 Microsoft Access 2003 Introduction To Microsoft Access 2003.

Similar presentations


Presentation on theme: "XP 1 Microsoft Access 2003 Introduction To Microsoft Access 2003."— Presentation transcript:

1 XP 1 Microsoft Access 2003 Introduction To Microsoft Access 2003

2 XP 2 Define some key Access terminology Field – A single characteristic or attribute of a person, place, object, event, or idea. Record – A set of related field values. Table – A collection of records that identify a category of data, such as Customers, Orders, or Inventory.

3 XP 3 Illustration of fields, records and a table

4 XP 4 Relational database and keys A relational database is a collection of tables that are related to one another based on a common field. A field, or a collection of fields, is designated as the primary key. –The primary key uniquely identifies a record in the table. When the primary key of one table is represented in a second table to form a relationship, it is called a foreign key.

5 XP 5 Relating tables using a common field

6 XP 6 Open an existing database To open an existing database, you must first start Access. When Access is launched you will see the Access window, with the task pane on the right side of the window. From the task pane you can open an existing database by selecting the database you want from the list of Recently opened databases

7 XP 7 The Access window When a database is opened, the Access window and the Database window will be displayed. The Access window contains a menu bar, a toolbar, a task pane, and a status bar. In the Access window, use the task pane to create a new database or to open an existing database. –To create a new database, make a selection from the New section of the task pane –To open an existing database, select from the list of Recently opened databases or from the More files option

8 XP 8 The Database window The Database window is the main control center for working with an Access database. The Database window contains a menu bar, an objects bar, and a groups bar. –The Objects bar lists all the objects available in the database –The list of objects consists of tables, queries, forms, reports, pages, macros, and modules –You can click on any of the objects in the Objects bar to obtain a list of objects of that type

9 XP 9 Use the task pane to open a database

10 XP 10 Open an Access database table To open a table you must first open a database: –In the database window, select Tables on the objects bar –In the list of tables, select the table you want to open and click on the Open button –When a table is open it is in Datasheet view, which shows the table's data as a collection of rows and columns –Each row in the Datasheet view represents a record in the table

11 XP 11 Navigate a database table You can navigate through the records by using the navigation buttons displayed at the bottom of the Datasheet view window. The navigation bar allows you to: –Go to the first record in the table –Go to the previous record in the table –Go to the next record in the table –Go to the last record in the table –Create a new record for the table (sometimes called an append record)

12 XP 12 A table in datasheet view

13 XP 13 The navigation bar buttons

14 XP 14 What is an Access query? If you want to see just a portion of the data in a table you can create a query. A query is a question you ask about the data stored in a database table. Access responds by displaying the data according to your question. –For example, if you ask to see all the customers from New York, the response would be to display only the records whose state field matches with NY

15 XP 15 Open an existing query and create new queries You can open an existing query by clicking Queries on the Objects bar and then selecting the query you want to open. You can also create your own queries by clicking New on the Database window. To create a new query, you can use the Simple Query Wizard, which will bring you through the selections you want for your query.

16 XP 16 Navigating a query and sorting the results When you run and get the results of your query, you can reorganize the data by sorting the datasheet in either ascending or descending order. –Click the pointer anywhere in the column you wish to sort –Click the Sort Ascending or Sort Descending buttons on the Query Datasheet toolbar to sort the results in the desired sequence You can navigate through the records by using the navigation buttons on the Navigations toolbar.

17 XP 17 Sample Query Datasheet view

18 XP 18 Selecting fields to include in a query You can create a query that will display only selected fields from a table instead of displaying all fields. In the Simple Query Wizard dialog box, select which fields you want included in the query. –Move all the fields into the Selected Fields box –Move the fields one at a time –Remove fields out of the Selected Fields box by pressing one of the remove buttons If you wanted to select all the fields except one, you can move them all to the selected fields list and then remove the one field you don't want. Once you have made your selections, press Next to move to the next dialog box in the Wizard.

19 XP 19 The Simple Query Wizard

20 XP 20 Create an Access form A form allows you to view your data one record at a time. Forms are useful for maintaining, viewing, and printing records in a database. You can create your own form in the Forms Design window or you can use the Forms Wizard to create a form. The easiest way to create a form is to use the AutoForm Wizard.

21 XP 21 Use the AutoForm Wizard The AutoForm Wizard uses a table (or query) you select as the basis to create a form that displays all the fields of the table (or query). Once you have created your form, you can view the records one record at a time. The form has a navigation bar just like the navigation bar you have already used in the Table or Query Datasheet view.

22 XP 22 Access Form View

23 XP 23 Create, preview, and navigate a report You can create a report, which is a printed version of your data, that is formatted according to your specifications. The data in the report can consist of data from a single table or multiple tables. Access has a Reports Wizard that allows you to easily create a report. The report can be based on a table or it can be based on a query. –If the report is based on a query, it will contain the same fields that were selected for the query

24 XP 24 The Report Preview window

25 XP 25 Backup and restore a database You may want to create a backup of your data so that if you lose or damage your database, you can recover from the backup. You can use a backup tool, such as the Microsoft backup tool, or some other backup program. To restore the data from the backup, you need to use the same backup tool according to the instructions associated with that tool.

26 XP 26 Learn the guidelines for designing databases When designing a database, first try to think of all the fields of data that needs to be stored. Next, group the fields into tables. Each table will contain a group of related fields. You need to select a field in each table to become the primary key for that table. When tables will be related to one another, you need to include a common field in the two tables that will be used to form the relationship.

27 XP 27 Determining database fields

28 XP 28 Group the fields into tables

29 XP 29 Choose a primary key Choose a field or fields to serve as the primary key for the table. A primary key must uniquely identify each record in the table. Primary keys can consist of more than one field. –Primary keys with more than one field are called composite keys

30 XP 30 Include a common field When one table needs to be related to another table, you must include a common field. The common field will be the primary key in one table. The common field is referred to as a foreign key in the related table. The foreign key in a table can then be used as a primary key to access the record in the related table.

31 XP 31 Data redundancy wastes space and can lead to data errors

32 XP 32 Setting field properties When assigning a name to any object in Access, carefully select a name that will indicate what data is stored there. Field properties include their data type, field sizes, and an optional description of the field. When selecting a field size, make sure the size is big enough to hold the largest piece of data that will be stored there. –Do not make the field larger then necessary because this will result in wasted disk space Make sure the data type you select for a field is appropriate for the kind of data to be stored in that field.

33 XP 33 Access field types, slide 1

34 XP 34 Access field types, slide 2

35 XP 35 Create a new database You can create a new database by using a Database Wizard or by creating a new, blank database. When you create a new database, you will need to create all the tables, queries, forms, and reports for the database. –This is the most flexible approach, since you will create all objects yourself

36 XP 36 Create a database without using the Database Wizard To create a new, blank database without using the Database Wizard: –Start Access –Click Blank Database in the task pane –In the dialog box, navigate to the location where you will save your database –Enter the name of the database in the File name text box –Click the Create button

37 XP 37 Create a new table

38 XP 38 Define fields, and specify a table's primary key When you create a table, you name the fields and define the properties for the fields. –The table structure is set up and modified in Design View –In Design View, you will define each field that will be included in the table When all the fields have been defined, you will then specify which field(s) will be the primary key. –The primary key is not mandatory, but it is a good idea to assign one

39 XP 39 The database Design View window

40 XP 40 Choosing a primary key Click a row selector for the field you want to use as the primary key, and then click the Primary Key button on the toolbar. After clicking the Primary Key button, a key symbol appears in the row selector to indicate the key field.

41 XP 41 Save the new table When all fields have been defined and properties have been set, you must save the table structure: –Click the Save button on the Table Design toolbar –Type the name you want to assign to the table into the Table Name text box of the Save As dialog box –Click the OK button to save the table using the specified name

42 XP 42 Add records to a table using Datasheet View Once the table has been created, you can then add records to the table using Datasheet View. As you enter records, they will be placed in the order in which you enter them. However, when you close the table and open it again, the records will be ordered according to the primary key order. The navigation bar at the bottom of the Datasheet view will indicate how many records are in the table and what the current record is (i.e., the record on which your cursor currently rests). You can move through the fields in the table by pressing the Tab key. Once your cursor is moved off a record, that record is automatically saved on your disk.

43 XP 43 Datasheet View with 2 records added

44 XP 44 Modify the structure of a table by deleting, moving, and adding fields The structure of a table can be modified after it has been created. To delete a field, enter Design View, right-click on the field, and then click Delete Rows on the drop down menu. To move a field, (you also do this in Design View) click on the field you want to move, and while holding your mouse button down, move the field to the desired location. To add a field in Design View, right-click the field where you want to insert the new field and then click Insert Rows on the dropdown menu.

45 XP 45 Moving a field in Design View

46 XP 46 Adding a new field in Design View 1. Right-click the row selector for the field you want to insert the new field in front of--StartDate in this figure. 2. Select Insert Rows from the shortcut menu, and a new, blank row will be inserted before the row you selected, as shown below. 3. Enter the information for the new field.

47 XP 47 Change field properties You can make additional modifications to the structure of a table by changing the properties of the table's fields. –For example, if you have a field that represents a currency value but you do not want to display dollar signs, you could change the format to a standard format –In the Design View, you will find a list of all formats available to you. You can make a selection from the list of options –Each data type has a separate set of options available in the Field Properties portion of the Table Design Window Field properties are changed in the Design View window.

48 XP 48 Changing field properties in Design View

49 XP 49 Copy records from another Access database If the data you want in your database already exists in another Access database, you can copy the records from that database into your database. You can use cut and paste to do this: –Open the database that contains the records you want to copy –Select the records you want to copy and then press the Copy button. This places the records onto the Windows clipboard –Open the database to which you want to copy the records and open the desired table to receive the copied records –Place your cursor on the next available row in the table and press the Paste button

50 XP 50 Delete and change records Once records have been added to a table, they can be deleted or modified: –In Datasheet view, click the row selector for the record(s) you want to delete and then click the Delete Record button on the toolbar To change or modify a record: –Place your cursor on the record and then on the field you want to change –You can then edit the field's value as you wish by typing in new data You can switch from navigation mode to editing mode depending on what you want to do at the time. –When you are editing a record, you are in editing mode, Otherwise you are in navigation mode –Editing mode is indicated by a pencil symbol in the left margin of the datasheet view

51 XP 51 An alternate method for deleting a record

52 XP 52 Keystroke techniques for navigation and editing modes

53 XP 53 Create, run, and save queries From the fields list, either drag or double-click fields that you want included in the query. –A query result differs from a table's datasheet view in that only selected fields are displayed If you move a field to the design grid and then you want to remove it, you can click on the field's column and then press the delete key. The results of the query will be displayed in order by the primary key of the table unless you specify another sort order. You can save the query and give it a name by pressing the save button on the toolbar.

54 XP 54 Selecting, displaying and sorting fields

55 XP 55 A sample query datasheet

56 XP 56 Sort data in a query You can control the order of data displayed in a query by altering the queries sort key. Choose a field on which you want the data to be sorted and then specify whether you want the data sorted in ascending or descending order. Specify multiple fields as the sort key if you want to arrange data in sorted order within groups of data. Specify sort criteria for the query in the query design grid.

57 XP 57 Sort results by data type

58 XP 58 Use the And and Or logical operators When you need to use multiple conditions for a query, you can use the logical operators to combine conditions. –The And logical operator specifies that both conditions must be met –The Or logical operator specifies that one or the other of the conditions must be met When you enter two conditions on the same row of the query design grid, an And condition is created. If you enter two conditions that are on separate rows, an Or condition is created.

59 XP 59 Illustration of And and Or logic

60 XP 60 Creating And condition in the design grid

61 XP 61 Create a form using the Form Wizard You can create a form from scratch or you can create a form using the Form Wizard. The Form Wizard will lead you through a series of choices to help you develop the form based on a table or a query. You will need to select the type of layout you want for your form, the style of the form, and a name for the form. After you have selected the table or query on which the form will be based, you will select which field(s) will be used on the form.

62 XP 62 Open the Form Wizard dialog box

63 XP 63 Use Form Wizard to choose a form layout

64 XP 64 Use Form Wizard to select a style for the form

65 XP 65 Completed Form

66 XP 66 Change a form's AutoFormat You may want to change the appearance of a form after it has been created with the Form Wizard. Clicking on the AutoFormat button and then make your selection. Click the button beside each format to view a sample of that particular format. Once you have decided on a format, click OK.

67 XP 67 A completed form created with the Form Wizard

68 XP 68 The AutoFormat dialog box

69 XP 69 Find data using a form You can navigate through all the records in a form, but you may want to find a particular record more quickly. The Find command allows you to specify the record you want to see and then will navigate directly to that record. To use the Find command: –Place your cursor in the form on the field for which you want to search –Press the Find button and enter the value you are looking for The form will display the record(s) that match your Find criteria.

70 XP 70 Setting up a Find operation

71 XP 71 An example of a Form with subform

72 XP 72 Create a report using the Report Wizard You can easily create a formatted printout of data in table(s) in a database by using the Report Wizard. The Report Wizard will ask you a series of questions to help you format the report. Once the report has been created, either with the Report Wizard or your own design, you can change the design later. You will find that the choices you make in the Report Wizard are similar to the choices in the Form Wizard. Choices include grouping and sorting options, as well as report layout options. You can preview the report to view how it will look when printed.

73 XP 73 Grouping report data

74 XP 74 Sorting report data You can sort the data on a particular field or on several fields. If you choose to sort on two or more fields, the grouping is in order as selected on the Sort Order portion of the Report Wizard. –If you choose to sort on State and then on City, the report would be sorted on State and then within each State group, the data would be sorted on City

75 XP 75 The Report Wizard Sort dialog box

76 XP 76 Choose a report layout

77 XP 77 Insert a picture in a report You can insert a picture into a report to improve its appearance. The picture can be from scanned images, images created in Microsoft Paint, or a picture created in some other graphic program. Once the picture is inserted into the report, you can move it around and size it to your preference.

78 XP 78 Insert a picture The picture you insert must be created before you try to insert the picture. Be sure you know where the picture is located on your disk before you begin to insert the picture. To insert the picture: –Click Insert on the menu bar –Select Picture from the drop-down menu –Navigate to the location of the picture and select it –Press the OK button to insert it

79 XP 79 Moving a picture in a report


Download ppt "XP 1 Microsoft Access 2003 Introduction To Microsoft Access 2003."

Similar presentations


Ads by Google