30
Introduction to Access 2003 Technical Support Services Office of Information Technology, West Virginia University OIT Help Desk – 293-4444 x 1 http://oit.wvu.edu/support/training/classmat/db/ Instructors: Kathy Fletcher, Bob Haring-Smith Last revised: January 19, 2006 Copyright 2005 West Virginia University

Introduction to Microsoft Access 2003

  • Upload
    others

  • View
    9

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Introduction to Microsoft Access 2003

Introduction to Access 2003

Technical Support ServicesOffice of Information Technology, West Virginia University

OIT Help Desk – 293-4444 x 1

http://oit.wvu.edu/support/training/classmat/db/

Instructors: Kathy Fletcher, Bob Haring-Smith Last revised: January 19, 2006

Copyright 2005 West Virginia University

Page 2: Introduction to Microsoft Access 2003

Table of Contents Course Description ....................................................................................................... 1 Getting Started .............................................................................................................. 2

Launching Access...................................................................................................... 2 Activity 1 – Getting familiar with the Access environment ............................................................ 2

Access Environment..................................................................................................... 3 Database Window...................................................................................................... 3 Menus, Toolbars and Status Bar ............................................................................... 4 Object Utilities ............................................................................................................ 5

Activity 2: Managing Database Objects........................................................................................ 6 Database Utilities ....................................................................................................... 7

Creating Databases....................................................................................................... 8 Creating A New Database From Scratch ................................................................... 8

Activity 3 – Create A New Database Named SCHOOL.MDB ...................................................... 9 Create a New Table ................................................................................................... 9 Inserting a new field in the Design view of a table ................................................... 10 Access Field Data Types ......................................................................................... 11 Naming Conventions for Fields and Objects............................................................ 11 Designating a Primary Key ...................................................................................... 12 Switching between Table Views .............................................................................. 12

Activity 4 – Creating Tables In Design View............................................................................... 13 Data Entry................................................................................................................ 17

Activity 5 – Add Additional Records to Your Tables ................................................................... 17 Table Utilities: Datasheet View ................................................................................ 19

Activity 6 Practice Selecting Records, Moving Columns, Changing Font, etc. .......................... 20 Find Command ............................................................................................................ 20

Activity 7 – Using the Find Command ........................................................................................ 21 Sorting Data in a Table ............................................................................................... 22

Activity 8 – Using the Sort command.......................................................................................... 22 Advanced Table Utilities............................................................................................. 23

Inserting Columns or Fields in a Table..................................................................... 23 Hiding and Unhiding Columns ................................................................................. 23 Freezing And Unfreezing Columns .......................................................................... 24

Creating a Data Entry Form........................................................................................ 25 Activity 9 – Creating a form using the Autoform Wizard............................................................. 25

Record Navigation in Form View.............................................................................. 26 Creating A Simple Report........................................................................................... 27

Activity 10 – Creating a Report using the Autoreport Wizard (Tabular) ..................................... 27 Learning More About Access XP (2002).................................................................... 28 How to Exit Access Properly...................................................................................... 28

ii

Page 3: Introduction to Microsoft Access 2003

Course Description Microsoft Access is a program for creating and maintaining databases. A database is a collection of information that's related to a particular subject or purpose, such as tracking customer orders or maintaining a music collection. If your database isn't stored on a computer, or only parts of it are, you may be tracking information from a variety of sources that you have to coordinate and organize yourself. For example, suppose the phone numbers of your suppliers are stored in various locations: in a card file containing supplier phone numbers, in product information files in a file cabinet, and in a spreadsheet containing order information. If a supplier's phone number changes, you might have to update that information in all three places. In a relational database, however, if the database is truly relational and efficient*, you should only have to update that information in one place — the supplier's phone number is automatically updated wherever you use it in the database. In the five classes taught here you will learn the basic skills for using and understanding the software’s feature’s and commands. This will not turn you into a database programmer. It is not our intention to do so. Our goal is to assist you to learn the software, understand some basic concepts and show you some tips and techniques so you can develop your database management skills over time. The five workshops are:

• Introduction to Access

• Access Queries

• Access Reports

• Access Database Design

• Access Form Design

Thank you, The OIT Technical Support Services Trainers West Virginia University * You can have a database that is not relational and it will not work this way.

Introduction to Access 1

Page 4: Introduction to Microsoft Access 2003

Getting Started

Launching Access Access is launched exactly like other applications.

1. Click on the Start button in the Taskbar to display the Start menu.

2. Select the Microsoft Access entry from the Programs menu. You might have to look under MS Office first.

− You may have a different method or shortcut available to you when you return to your office or to your home computer.

In the computer lab today, click on the icon on the taskbar (it will look like a purple key) When you first start up Access, you will see the Task Pane toolbar (illustrated at right). In Activity 2 we will create a new blank database. Before creating a new database we will first get oriented with the Access working environment.

Activity 1 – Getting familiar with the Access environment We will open an existing database to begin our orientation.

1. Click the More Files icon in the topmost Open a file section of the Task Pane. 2. Use the standard Open file dialog to locate and open the Access folder. 3. Open the Northwind.mdb file.

• Note: Access databases end with the file extension .mdb

• The Northwind file is a sample database that comes with Microsoft Office intended for learning and practice. If it is not already installed on your computer you may need to install it from your Office CD.

4. When you open the Northwind database, you will see a splash screen giving you some general information about the database. Click on the OK button in the lower right corner of this splash screen dialog to continue.

5. Click the Display Database Window button in the Main Switchboard window.

2 Introduction to Access

Page 5: Introduction to Microsoft Access 2003

Access Environment

Database Window

Title bar View Shortcuts Command buttons

Objects List

Groups list

• The title bar of the database window shows the name and file format of the database.

• The left pane of the database window contains the Objects list. Clicking an object name entry in the list allows you to view, edit and create objects of that type. Individual objects are displayed in the right pane of the window.

• On the database window toolbar, use the Open button to work with existing objects, use the Design button to modify existing objects, or use the New button to create new objects.

• A list of groups of database objects appears under the Groups bar. You can add objects of different types to a group, which consists of shortcuts to the database objects that belong to it. When you click the Groups bar in the database window and then click the icon for your group, all of the database objects that you have added to the group appear in the list in the right pane of the database window.

• Use the View shortcut icons at the top of the database window toolbar to change how the objects are displayed.

Introduction to Access 3

Page 6: Introduction to Microsoft Access 2003

Menus, Toolbars and Status Bar

• Menus

− The menu bar in Access works like menus in other Windows programs.

− The contents of the menu will vary depending on which type of object you are viewing and whether you are in design view, datasheet view or print preview.

− Click your mouse on each menu listed across your menu bar to see a list of commands for that menu item.

• Toolbars

− Toolbars are a collection of buttons and menu items to make menu commands available with a single mouse click.

− Toolbars change from window to window (screen to screen) so careful attention should be paid to the available tools.

− To find out what a button does, hold your mouse over it for a few seconds. A ToolTip is displayed; it is a small box with the name of the button. ToolTips are handy when you cannot figure out or remember what the picture on the button means.

− For more information on a button, press Shift F1. Your cursor will change to an arrow & question mark; use this new cursor to click on the button.

− When you are comfortable using Access software, you can customize your toolbars and/or move them around on the screen.

− For an overview of commonly used toolbar buttons in Access, refer to that page in the Supplemental handout document.

• Status bar

− The status bar, located at the bottom of the screen, provides message and data display services.

− Using property settings, you can often customize the text displayed on the status bar.

4 Introduction to Access

Page 7: Introduction to Microsoft Access 2003

Object Utilities You can manage database objects directly from the database window. First select the desired object by clicking on it to highlight the object’s name. Then select one of the following utility procedures:

• Deleting − Choose the Delete command from the Edit menu or

− Right click on the object and choose the Delete command or

− Click on the object and use the Delete shortcut in the toolbar or

− Press the Delete key

• Renaming − Choose the Rename command from the Edit menu or

− Right click on the object and choose the Rename command

• Copying − Choose the Copy command from the Edit menu or

− Right click on the object and choose the Copy command

− Right click on a blank area and choose Paste to insert a copy of the object (or choose the Paste command from the Edit menu).

• Printing − Choose the Print command from the File menu or

− Right click on the object and choose the Print command

• Preview − Choose the Print Preview command from the File menu or

− Right click on the object and choose the Print Preview command

Introduction to Access 5

Page 8: Introduction to Microsoft Access 2003

Activity 2: Managing Database Objects Use the NORTHWIND.mdb file

1. Open the Employees table.

− Notice how a table resembles a spreadsheet.

− Switch to Design view by choosing the Design View command from the View menu. You could have also selected the table in the database window and clicked the Design command shortcut in the database window shortcut toolbar.

− Close the Employees table by choosing the Close command from the File menu or by clicking on the X on the table’s title bar.

2. Open the Employees form.

− Notice how a form displays table data differently. Close it. 3. Preview the Catalog report.

− Display 2 pages at same time. Use the Page Down key. Close it. 4. Select the Tables object. 5. Copy the Orders table by right clicking it and selecting Copy from the shortcut menu 6. Click on the white area (still in Tables tab) to remove any highlighting. 7. Right click on the white area and choose Paste.

− Name your copy of this table Order2. 8. Rename Order2 to New Order (right click on it, select Rename, type New Order). 9. Delete New Order (click on it, press the Delete key, click on Yes to confirm deletion). 10. Close NORTHWIND.mdb database.

We will create a new database in the next activity.

6 Introduction to Access

Page 9: Introduction to Microsoft Access 2003

Database Utilities

• Deleting, copying, or renaming databases These utility functions must be accomplished outside of Access using the Windows File Explorer, DOS command language, or a commercial file management package such as Norton Commander. You CANNOT make a copy of the entire database inside Access. While in Windows Explorer, you can right click on an mdb database file and choose Copy, Rename, Delete, or Send To. If you choose Copy, you will also have to right click on a blank area in a destination folder and choose Paste to complete the copy operation. There are multiple ways to copy, delete, and rename files.

• Backing up a database Access database objects are all stored in one file. Therefore it is extremely important that you protect your data by creating backups at regular intervals. Also create a backup copy of your database before you attempt certain procedures or queries or anytime you are unsure of what you’re doing. Access does not have any internal back up procedure. To make a back up of your database, you must exit Access and copy your database file(s). See above for details on one way to copy files.

Additional database utilities will be discussed in the Access Database Design workshop.

Introduction to Access 7

Page 10: Introduction to Microsoft Access 2003

Creating Databases When you are creating a new database, you have the options of building it yourself or having an Access wizard create it for you.

− Details on using the Database Wizard appear in the Supplemental handout.

Creating A New Database From Scratch This option should be selected when you wish to create the database objects from scratch or when you plan to import or link objects from another database. There are several ways to create a new database. The following method will outline the basic procedure to do this. Annotations of alternatives have been added where necessary.

1. Select the New command from the File menu.

− This displays the Task Pane window. 2. In the Task Pane window you have 2 options:

• Click the Blank Database entry under the New section within the Task Pane window. This displays the New File Database file dialog box on the screen allowing you to name the new database and specify its storage location.

• Click the General Templates… entry under the New from template section within the Task Pane window.

− This will display the Templates dialog box allowing you to choose a pre-defined database template. There are 2 sections from which you can choose a template. Click one of the following tabs in the dialog box.

General Tab − Provides the option to create a Blank Database, Blank Data Access Page,

Project (Existing Database), Project (New Database). Databases Tab − Allows you to select from a collection of pre-defined database templates.

NOTE: In Access 2002 and higher, you may see a 3rd tab at the top of the Templates dialog box named “Office 97 templates”. This is the result of having an older version of Access still installed on your computer. Access 2002 and 2003 CANNOT use the older Office 97 Templates.

8 Introduction to Access

Page 11: Introduction to Microsoft Access 2003

3. In the General Tab section of the dialog box click the Blank Database icon then click the OK button at the bottom right corner of the dialog box.

− This displays the standard Save As file dialog box on the screen allowing you to name the new database and specify the storage location for the new file. NOTE: You can also double-click the Blank Database icon instead of clicking the OK button.

4. Name the new database, specify the storage location and click the OK button.

− A new blank database window is displayed on screen.

Activity 3 – Create A New Database Named SCHOOL.MDB

1. Select the New command from the File menu. 2. Click the Blank Database entry under the New section within the Task Pane window. 3. In the New File Database dialog box name the file SCHOOL.mbd and change the

current (Save In:) directory to your Access folder on your desktop.

Create a New Table Access tables are used to store the information in the database. There are several ways to create a table: Design View, Datasheet View, or the Table Wizard. Tables can also be created by importing from or linking to other databases. These last two methods will be covered in another workshop. For now, we are going to concentrate on using Design View. To create a table in the design view:

1. Name each field 2. Select a data type for each field 3. Designate the primary key field 4. Set field properties 5. Supply field descriptions (optional)

Introduction to Access 9

Page 12: Introduction to Microsoft Access 2003

Field Facts

• Each field name can be up to 64 characters long. In this example, each field starts with the first letter of the table name. Read about naming conventions on the next page.

• Use the tab key to move from item to item. The black triangle indicates which field you are currently working on.

• Field Properties are set in the area below, under the General tab.

Inserting a new field in the Design view of a table

1. Click on the gray tab at the extreme left of the field that is to be shifted down (i.e. the field that will end up directly below the inserted field.) The field row should be highlighted.

2. Right-click on it, then select Insert Row from the shortcut menu (or choose Insert / Rows).

− You can also drag and drop rows in this view to rearrange the order of your fields. Deleting A Field

• To delete a field, select it by clicking to the left of it so that the field row is highlighted and press the Delete key (or choose the Delete command from the Edit menu).

− Click on the Yes button to confirm this action. NOTE: There is no Undo for this !

10 Introduction to Access

Page 13: Introduction to Microsoft Access 2003

Access Field Data Types AutoNumber Holds automatic record numbering

Date/Time Holds dates and times in a variety of common formats

Currency Holds monetary data

Text Holds characters, numbers, punctuation, special symbols (up to 255 characters); use a Text data type to store data such as names, addresses, and any numbers that do not require calculations, such as phone numbers, part numbers, ssn, or postal codes. The number of characters stored in a text field can be changed.

Memo Stores a large quantity of text (up to 65,535 characters). The number of characters stored in a Memo field cannot be changed.

Number Holds only numbers, plus/minus signs, and decimal places

Yes/No Stores either a Yes or No value (or True/False etc.) Appears in Datasheet view as a check box. Also referred to as a Logical or Boolean type.

Hyperlink Text used as a hyperlink address, with up to three parts: display text, address, and sub address (location within a page).

OLE Holds graphics, sounds, and other Object Linking and Embedding objects.

Naming Conventions for Fields and Objects In Microsoft Access, names for fields and objects can be up to 64 characters long and can include letters, numbers, spaces, and most special characters except for the period, exclamation point, accent grave `, and square brackets [ ].

• You cannot begin a field name with a space or blank.

• Field names within a table must be unique. You might want to avoid naming queries or other objects with the same name as one of your tables. Some people name all queries starting with the letters q or qry, all forms with the letter f or frm, and reports with r or rpt.

• Avoid using extremely long names as they are difficult to remember and to refer to.

• You might also want to avoid using spaces anywhere in field names if you are planning to write macros or modules or use Visual Basic for Applications with this database.

• Avoid specifying a name for a field that could cause a conflict with built in Microsoft Access functions or property names (e.g. Name).

Introduction to Access 11

Page 14: Introduction to Microsoft Access 2003

Designating a Primary Key One field that contains unique data should be designated as the primary key for the table.

• To designate a primary key in the table design view, highlight the desired field and select Primary Key from the Edit menu or click on the Primary Key button on the Toolbar.

• You can have only one primary key per table (but can be a combination of more than 1 field).

Switching between Table Views You can switch between the Design View and the Datasheet View of a table by selecting the desired view from the View menu or you can click on the View button on the Toolbar. The design view displays the table structure and properties while the datasheet view displays the contents of the table. In these views, Access displays a set of icons along the left edge of the table to provide you with some status information:

Primary Key The key in design view denotes the primary key field of the table.

Record pointer A triangle in datasheet view denotes the current record. In design

view, the triangle marks the current field.

Next record An asterisk denotes the first blank record in the table that will be

used to add a new record.

Edit record A pencil indicates that the record is currently being edited.

12 Introduction to Access

Page 15: Introduction to Microsoft Access 2003

Activity 4 – Creating Tables In Design View Create a table named TEACHER in the database named SCHOOL.MDB

1. In the Database Window: SCHOOL, click the Table object entry in the Objects list if it is not already selected.

2. Click the New button in the database window toolbar.

− This displays the New Table dialog box. 3. Select Design View. 4. When the Table Design View window appears, enter the following to define the table.

Field Name Data Type Properties Description

T-ID AutoNumber Primary key

T-LName Text Field Size = 20 Teacher’s Last Name

T-FName Text Field Size = 15 Teacher’s First Name

T-Dept Text Field Size = 15 Academic Department

T-Office Text Field Size = 15 Room and Building

T-HireDate Date Teacher’s Hire Date

5. Designate the T-ID field as the primary key.

− Either select the T-ID field row or place your insertion point in the field and choose the Primary Key command from the Edit menu.

6. When the table specifications are complete, change to the Datasheet View and assign the table the name TEACHER. Then enter the following data records:

T-LName T-FName T-FName T-Office T-HireDate

Rimmer Arnold Journalism 113 Austen 0714/90

Lister David Education 624-B Kemp 08/25/92

7. Close the table to return to the Database window.

Introduction to Access 13

Page 16: Introduction to Microsoft Access 2003

Create a table named STUDENT in the database named SCHOOL.MDB

1. In the Database Window: SCHOOL, click the Table object entry in the objects list if it is not already selected.

2. Click the New button in the database window toolbar.

− This displays the New Table dialog box. 3. Select Design View. 4. When the Table Design View window appears, enter the following to define the table.

Field Name Data Type Properties Description

S-ID AutoNumber Primary key

S-LName Text Field Size = 20 Student’s Last Name

S-FName Text Field Size = 15 Student’s First Name

S-Major Text Field Size = 15 Major Field of Study

S-Hair Text Field Size = 6 Hair Color

PAID Yes / No Paid current term fee?

5. Designate the S-ID field as the primary key.

− Either select the S-ID field row or place your insertion point in the field and choose the Primary Key command from the Edit menu.

6. When the table specifications are complete, change to the Datasheet View and assign the table the name STUDENT. Then enter the following data records:

S-LName S-FName S-Major S-Hair Paid

Thompson Moose Journalism Black No

Dugan Arnie CS Blonde Yes

7. Close the table to return to the Database window.

14 Introduction to Access

Page 17: Introduction to Microsoft Access 2003

Create a table named TEXTBOOK in the database named SCHOOL.MDB

1. In the Database Window: SCHOOL, click the Table object entry in the objects list if it is not already selected.

2. Click the New button in the database window toolbar.

− This displays the New Table dialog box. 3. Select Design View. 4. When the Table Design View window appears, enter the following to define the table.

Field Name Data Type Properties Description

B-ID AutoNumber Primary key

B-Title Text Field Size = 50 Textbook Name

ISBN Text Field Size = 15 Book Number

B-YR Text Field Size = 4 Year of publication

5. Designate the B-ID field as the primary key.

− Either select the B-ID field row or place your insertion point in the field and choose the Primary Key command from the Edit menu.

6. When the table specifications are complete, change to the Datasheet View and assign the table the name TEXTBOOK. Then enter the following data records:

B-Title ISBN B_YR

Oracle 8: the Complete Reference 0-07-882396-X 1997

The First Time Manager 0-8144-7940-5 1997

7. Close the table to return to the Database window.

Introduction to Access 15

Page 18: Introduction to Microsoft Access 2003

Create a table named CLASS in the database named SCHOOL.MDB

1. In the Database Window: SCHOOL, click the Table object entry in the objects list if it is not already selected.

2. Click the New button in the database window toolbar.

− This displays the New Table dialog box. 3. Select Design View. 4. When the Table Design View window appears, enter the following to define the table.

Field Name Data Type Properties Description

C-ID AutoNumber Primary key

C-Code Text Field Size = 15 Catalog Code

C-Name Text Field Size = 25 Course Title

C-Day Text Field Size = 2 Class Day

C-Time Text Field Size = 2 Starting Time

C-Room Text Field Size = 6 Classroom

C-Cost Number Single Course Cost

C-Hrs Number Integer Credit hours

5. Designate the C-ID field as the primary key.

− Either select the C-ID field row or place your insertion point in the field and choose the Primary Key command from the Edit menu.

6. When the table specifications are complete, change to the Datasheet View and assign the table the name CLASS. Then enter the following data records:

C-ID C-Code C-Name C-Day C-Time C-Room C-Cost C-Hrs

1 CS260 Database Design Mo 9 ESB113 $250.00 4

2 J219 Desktop Publishing Tu 10 M37 $250.00 3

7. Close the table to return to the Database window.

16 Introduction to Access

Page 19: Introduction to Microsoft Access 2003

Data Entry Entering data in a datasheet You can enter data directly into the rows of a datasheet by simply typing the data into the cells. Use the tab key to move from cell to cell. A tab key press in the final column in a record will move you to the beginning of the next record. When you move to another record, Microsoft Access saves your changes.

• The Data Entry option for tables can be activated from the Records menu. It hides all completed records and places the current blank record directly under the column headers.

− To unhide the records, select the Remove Filter/Sort command from the Records menu.

• Cut, copy, and paste: Field data can be cut from, copied from, or pasted into the table cells by selecting the data and choosing the appropriate command from the Edit menu.

− The shortcut keys of Ctrl X for Cut, Ctrl C for Copy, and Ctrl V for Paste can also be used.

• The Ditto command can be used to repeat a field entry from the previous record into the current record.

− To issue the ditto command, press Ctrl ' or Ctrl " .

• To insert today’s date in date/time or text cell, press Ctrl ; • To undo a cell entry, press Ctrl Z or choose Undo from the Edit menu.

• To undo an entire record’s entry before you start the next record, press the Escape key twice.

Activity 5 – Add Additional Records to Your Tables TEACHER Data

T-ID T-LName T-FName T-FName T-Office T-HireDate 1 Rimmer Arnold Journalism 113 Austen 0714/90 2 Lister David Education 624-B Kemp 08/25/92 3 Keaton Alex Business 247 Smith 9/30/85 4 Shaunessy Hap Journalism 113 Austen 7/8/92 5 Green Bernice Education 620 Kemp 2/12/82 6 Peterson Marilyn CS 720 Saunders 5/19/75 7 Harmon Diana CS 713 Saunders 2/22/90 8 Campbell Scott Business 312 Smith 7/1/85

Introduction to Access 17

Page 20: Introduction to Microsoft Access 2003

STUDENT Data

S-ID S-LName S-FName S-Major S-Hair Paid S-Score S-Gender S-BDay 1 Thompson Moose Journalism Black No 300 2 11/1/74 2 Dugan Arnie CS Blonde Yes 400 2 2/12/72 3 Hatfield Buster Business Gray No 450 2 3/26/48 4 Humphrey Dalton Business Brown Yes 500 2 6/14/72 5 Piccolo Jennifer Business Black Yes 550 1 9/7/75 6 Simpson Joan Business Red No 600 1 7/8/78 7 Templeton Charles CS Brown No 800 2 4/15/72 8 Green Harold CS Black Yes 250 2 11/17/70 9 Singleton Junior CS Black No 350 2 1/27/65 10 Hoover Sparky CS Red Yes 400 2 12/6/68 11 McClintock Andrea Education Brown Yes 600 1 5/19/75

TEXTBOOK Data

B-ID B-Title ISBN B-YR 1 Oracle 8: the Complete Reference 0-07-882396-X 1997 2 The First-Time Manager 0-8144-7940-5 1997 3 Argumentation Theory and the Rhetoric of Assent 0-8173-0509-2 1991 4 Applied Management Science 0-47-113776-6 1998 5 Learning SAS(r) in the Computer Lab 0-534-23442-9 1998 6 Graphic Design for the Electronic Age 0-8230-2122-X 1988 7 Enhancing Adult Motivation to Learn 1-55542-525-9 1993 8 The Instructional Design Process 0-06-043589-5 1985 9 An Introduction to Database System 0-201-14471-9 1982 10 Multimedia: Making it Work 0-07-881869-9 1993

CLASS Data

C-ID C-Code C-Name C-Day C-Time C-Room C-Cost C-Hrs1 CS260 Database Design mo 9 ESB113 $250.00 4 2 J219 Desktop Publishing tu 10 M37 $250.00 3 3 CS360 Oracle Software we 9 ESB113 $280.00 4 4 MGT214 Information Systems th 2 B&E221 $250.00 4 5 ED311 Adult Learning mo 4 A411 $200.00 3 6 CS221 SAS th 10 ARM209 $250.00 3 7 ED30 Multimedia tu 2 A411 $250.00 4 8 J50 Communications fr 9 M101 $200.00 2 9 MGT101 Management Principles we 3 B&E259 $200.00 3 10 ED240 Instructional Design fr 1 A635 $220.00 3

NOTE: The sample database SCHOOL1.MDB contains all of the activities completed to this point in the workshop. Close SCHOOL.MDB and open SCHOOL1.MDB.

18 Introduction to Access

Page 21: Introduction to Microsoft Access 2003

Table Utilities: Datasheet View Select records To select a record, click on the shaded tab to the left of the first column. To

select a group of contiguous records, click and hold on the shaded tab of the first record and drag to select the group.

Select columns or fields

Columns can be selected by clicking on the column header when the heavy down arrow appears. Field data can be selected by double clicking in the field. Multiple items can be selected by dragging the left mouse button.

Delete records To delete a record or group of records, select the desired records and press the Delete key.

Change table display font

Go to the Format menu and select Font. Select a new font, style, and size as you prefer. Click the OK button. This font change affects all cells in the datasheet view.

Change column width

Position your cursor on the column divider (crevice) between column headers. Your cursor will change to a double headed arrow. You can drag and drop the new cursor to make the column wider or narrower. Double click on the header divider to make the column just wide enough to accommodate the widest amount of text (including the column header text).

Move columns Columns can be moved by first selecting the column and releasing the mouse button. Then click on the column header again and hold the mouse button down. Drag left or right until the heavy line is at the desired location of the column. Release the mouse button and the column will move.

Current Record Selected Column

Column Headers

Introduction to Access 19

Page 22: Introduction to Microsoft Access 2003

Activity 6 Practice Selecting Records, Moving Columns, Changing Font, etc. Using the knowledge you have learned practice manipulating the data in the tables you have created in the previous activity.

Find Command To locate records with field values that match all or part of a particular value:

1. Open a table and select the field that you want to search by clicking on the column header to highlight the column.

2. Select the Find command from the Edit menu (Ctrl F) or click the Find button on the toolbar (Binoculars icon).

− The Find and Replace dialog box is displayed.

3. Enter your search text (string) in the Find What: field.

− Wildcard characters can be used to fine tune the search.

Wildcard Meaning Example

? Any single character Sm?ith will find Smith, Smath, Smyth, etc.

* A string of zero or more characters JO* will find Job, Jones, Joseph, etc.

Null or Is Null

Unformatted blank fields Null will find empty or missing fields if you also specify Match-Whole Field

20 Introduction to Access

Page 23: Introduction to Microsoft Access 2003

4. Select your desired options and then click the Find Next button.

Option Meaning Criteria

Find What: The string to search for User entered text

Look In: Allows you to specify the current field or the entire table

Match: What portion of the field should match our search string?

Any Part of Field

Whole Field

Start of Field

Search: The direction of the search Up

Down

All

Match Case Should the field match the case of the search string?

Checked = Yes

Unchecked = No

Search Fields As Formatted

Should the formatting be considered part of the search?

Checked = Yes

Unchecked = No

• To Find additional records meeting the same criteria, click the Find Next button repeatedly.

• To resume the search after closing the Find Dialog Box, press Shift-F4.

Activity 7 – Using the Find Command

1. In your STUDENT table, find students whose last name starts with T. 2. Find students with Red hair.

Introduction to Access 21

Page 24: Introduction to Microsoft Access 2003

Sorting Data in a Table Sorting is arranging the data in some meaningful order. By default, Access displays the datasheet records on the screen in the order dictated by the primary key. To change the sort order of the display:

1. Select the desired sort field by clicking on the header to highlight the column. 2. Choose the Sort command from the Records menu then choose Ascending or

Descending sort order.

− You could also click on one of the sort buttons on the toolbar labeled with [A->Z] or [Z->A].

3. To remove the sort, choose the Remove Filter/Sort command from the Records menu.

Activity 8 – Using the Sort command

• Sort your STUDENT table by S-LName (student’s last name).

• Sort on Multiple fields.

22 Introduction to Access

Page 25: Introduction to Microsoft Access 2003

Advanced Table Utilities

Inserting Columns or Fields in a Table The two methods discussed below add a new field to the table. This can be done in either the Datasheet view or the Design view.

• Inserting a column (field) in the Datasheet View of a table.

− Open a table in the Datasheet View.

− Click on (highlight) the header of the table column that is to be shifted to the right (i.e., the column that will end up directly on the right of the inserted column).

− Right-click, then select Insert from the shortcut menu. Note: You can also select Rename or Delete from the shortcut menu.

• Inserting a field in the Design view of a table.

− Open a table in the design view.

− Click on the gray tab at the extreme left of the field that is to be shifted down (i.e., the field that will end up directly below the inserted field. The field line should highlighted).

− Right-click on it, then select Insert from the shortcut menu. Note: You can also select Rename or Delete from the shortcut menu.

Activity: Insert a new field named S-EyeColor between the S-Hair and Paid fields in the Student table in the SCHOOL2.MDB database.

Hiding and Unhiding Columns You can change the appearance of the datasheet on the screen by hiding and unhiding columns temporarily.

• To hide a column, select the column, then select the Hide command from the Format menu.

• To show hidden columns, select the Unhide Columns… command from the Format menu. Turn the checkbox On for the columns you want to show.

Activity: Hide and Unhide the new field named S-EyeColor in the Student table in the SCHOOL2.MDB database.

Introduction to Access 23

Page 26: Introduction to Microsoft Access 2003

Freezing And Unfreezing Columns You can freeze one or more columns on the left side of the table while horizontally scrolling other columns to the right and left. A “frozen” column is shifted to the left side of the data table and does not scroll horizontally. This allows you to keep data that is widely separated in context to the “frozen” field when visually searching the data table.

• To Freeze columns

− Select the columns you want to freeze (use the Shift key to select multiple columns) and select the Freeze Columns command from the Format menu.

• To Unfreeze columns

− Select the Unfreeze All Columns command from the Format menu. Activity: Freeze and Unfreeze the field named S-LName and S-FName in the Student table in the SCHOOL2.MDB database.

24 Introduction to Access

Page 27: Introduction to Microsoft Access 2003

Creating a Data Entry Form You will learn more about creating and designing forms in the workshop: Access Form Design. In the meantime, here is a quick way to create a simple data entry form using an Autoform Wizard.

Activity 9 – Creating a form using the Autoform Wizard

1. Close any open tables and return to the Database Window view. 2. Click once on the STUDENT table to select it. 3. Click on the Autoform Wizard button (it looks like a form with a lightning bolt).

− If you do not see the Autoform Wizard button in your toolbar, select the Toolbars option from the View menu, and choose Customize. This displays the Customize dialog box. Click the Toolbars tab at the top of the dialog box. Turn the Form Design checkbox On. This will display the Form Design toolbar.

− Click the Autoform Wizard button. 4. You will now see your table’s data in a form instead of a datasheet view.

5. Click on the [ ►* ] button to add a new record.

6. Enter at least one more student into your table.

− Press tab to move from field to field. 7. Compare using the form to using a table for data entry. 8. Close the form.

− Access will prompt you to save it. Name it Student Form.

Introduction to Access 25

Page 28: Introduction to Microsoft Access 2003

Record Navigation in Form View While in Datasheet view, you are viewing several records at one time.

• You can use the scroll bar or the Page Down key to view the next screen of records. When you are in Form view, you are normally viewing one record at a time.

• You can use the Page Down key to view the next record.

• You can use the Go To command from the Edit menu to move to a specific record.

• You can also use the Find command from the Edit menu to find a specific record. You can also use the Record Navigation buttons available at the bottom of a form or table:

Current Record Number

Previous Record

First Record

Next Record

Last Record

Total Number of Records

Add New Record

• You can type a record number in the Current Record Number box and press enter to go to that record.

26 Introduction to Access

Page 29: Introduction to Microsoft Access 2003

Creating A Simple Report You will learn more about creating and modifying reports in the workshop: Access Reports. In the following activity, we’ll use the Report Wizard to generate a simple report based on a table.

Activity 10 – Creating a Report using the Autoreport Wizard (Tabular)

1. Click on the Report entry in the Objects list. 2. Click on the New button on the right.

− This displays the New Report dialog box.

3. Click on AutoReport: Tabular. − This style will put the fields in

columns, as in Datasheet View.

4. Click on the down triangle next to the right of the empty field at the bottom of the dialog box to choose a table.

5. From the roll down list, select the TEACHER table.

6. Click the OK button.

− Wait until the wizard is finishes creating the report. 7. Review the report.

− Close the Print Preview by clicking on the Close button in the Print Preview toolbar. You will be returned to Report Design View.

8. Close the report.

− Access will prompt you to save it. Name it TEACHER Report. The database SCHOOL2.MDB contains all objects created in this workshop.

Introduction to Access 27

Page 30: Introduction to Microsoft Access 2003

Learning More About Access Microsoft Office Assistant If your Office Assistant is not visible in the lower right corner, then go to your Help menu and select the Show the Office Assistant entry. Access Help Window You can display the Access Help window by pressing F1. The Help window contains three tabs: Contents, Answer Wizard and Index. Contents: displays the contents of the help files in chapter form. Answer Wizard: allows you to enter a question. Clicking the Search button will instruct the wizard to find information that matches the text you entered as a question. Index: an alphabetic index of the keywords in the help files. You enter a word and the Help function finds appropriate matches for the keyword.

How to Exit Access Properly It is extremely important that you exit any database package using the commands provided for that purpose. It is important to note that severe damage to your data file can occur if you do not exit properly. To exit Access:

1. Close your open database by clicking in the X (close box) in the upper right corner of the database window or by going to the File menu and selecting Close.

− If you have any unsaved objects (e.g. forms, reports) open, you will be prompted to save them at that time.

2. Select Exit from the File menu.

28 Introduction to Access