Microsoft Access 2000 Level 1 Region 4 Teaching, Learning and Technology Center Kaplan, LA
Activity 1 Creating a Database 1. Open Microsoft Access 2000 a. Click on START, highlight Programs, point and click on Microsoft Access. 2. Click on Blank Access database. Click OK. 3. A window will appear asking you to give this file a name. Name this database Contacts. 4. Name your file and save it to the C:/My Documents. CAUTION: Saving to a floppy disk will be very slow because Access continually saves the data as you enter it into the database. Click on Create. 5. Make sure the Tables object is selected. Double-click on Create table by using wizard. Access 2000 Level 1 Page 2
6. The Table Wizard menu allows you to select the type of fields you wish to have in your table. Select fields from Contacts table by clicking on the field and then the greater than button. 7. Selected fields will appear in the window to the right. To remove a field, select the field and click on the less than button. Choose Title, FirstName, LastName, Address, City, State, PostalCode, and WorkPhone. When all fields are selected, choose Next. 8. Name your table Contacts and allow Access to set the primary key for you. Click Next. 9. Choose Enter data directly into the table. Select Finish. Access 2000 Level 1 Page 3
10. The Table (Contacts) you created will appear. Now it is time to learn how to design fields that are not in the Wizard. Close the table by clicking on the X in the upper right hand corner of this window. Proceed to Activity 2. Activity 2 Designing Fields in a Database 11. Select the table Contacts and click on the Design button. 12. Insert a HomePhone field before WorkPhone and insert the following fields at the end of the existing fields: Age Gender Position NOTE: The Data Type for most of our fields is Text. Click on the in the box to the right of your field name and a pull down list will appear. Select the data type from that list. Use Number or Currency only when you will use the data to calculate values. NOTE: To insert a field in a location between other fields, click on the field below where the new field will be located. Click on Insert menu, and select Rows. Type the name of the new field. 13. When you have completed designing the fields, close the design table. You will be asked if you want to save changes to the table. Select Yes. Open the table by double-clicking on the name, Contacts, Enter the data for the first five records displayed on the next page. Access 2000 Level 1 Page 4
Activity 3 Entering Data into a Table 14. The first field is the AutoNumber field. It is the primary key set by Access. You will not need to enter data in this field. 15. To enter data (called records) into a table, simply click in the field and enter the data from the keyboard. Pressing TAB key will move the cursor to the next field. At the end of the first record the cursor will automatically move back to the beginning of the next record. A record is the data entered into a set of fields in a database. 16. Enter the data from the first five rows in the chart below into your table. You will have an opportunity to enter some of the remaining data in the next activity. 17. Use the arrow keys or the mouse to move between records in the table to edit any record. Shift + Tab will move the cursor back one field. CTRL + will copy the information from the field directly above the current field. Activity 4 Creating a Database Form 18. Select the Forms object button. Click on the Create form by using wizard. Access 2000 Level 1 Page 5
19. Select the fields you wish to have displayed in your form by selecting the > button. To select all fields select the >>. Then choose Next. 20. The Form Wizard will now ask you to choose a layout. Select Columnar. Then click on Next. 21. Form Wizard prompts you for a style choice. Choose Standard and select Next. 22. Give your form the title Contacts. Select Finish. 23. Your form will appear. It will contain the first five records you previously entered. Click on the to move to record number 6. (See next page for figure.) Access 2000 Level 1 Page 6
24. If record 6 is not a blank record, click on the last arrow button to the right to move to a blank record. 25. To enter data, click in a field and enter the data. Press Tab to move to the next field and continue to enter data. Complete the rest of the records from the chart on Page 5. The next record will appear as soon as you enter the data into the last line and hit Enter. 26. Close the Contacts Form. Activity 5 Sorting Records in a Database 27. Click on the Tables object button. Double-click on Contacts table to open this table. 28. Move your cursor over the LastName field. If your cursor is over the gray box, it will change to a black arrow. Click your mouse to highlight the entire column. 29. Click the Sort Ascending button on the toolbar at the top of the screen. Your data will be sorted alphabetically from A to Z. 30. Chris Adams is now the first record in the table. Close the table by clicking on the X in the corner. Access will ask if you want to save changes. Click Yes. Access 2000 Level 1 Page 7
Activity 6 Creating a Query A Query differs from a sort in that a Query displays only particular records pulled out according to the criteria given. The example we will be using is pulling out all teachers age 30 and older. 31. Click on the Queries object button and double-click on Create Query in Design View. 32. Access wants to know what data you want to pull the Query from. In this case choose the Tables tab and select Contacts. Select the Add button and Close. 33. The window below will appear. There are 3 steps to building a Query. A. Selecting the fields B. Selecting the field to sort by. C. Selecting the criteria for the Query. Access 2000 Level 1 Page 8
34. The fields to select from are presented in pull down menu that will appear when you click in the field box. Choose the field category and move to the next field. For this Query add the following fields: Title, LastName, FirstName, Address, City, State, Postal Code, Age, and Position 35. Order of the fields matters so click and drag the LastName field before the FirstName field. This way is sorts the Last names before the first names. 36. To select the field to sort by, simply click in the Sort box underneath the category by which you want to sort. In this case chose LastName, click on the and choose Ascending. 37. Now it is time to set the criteria for the Query. Scroll over to the field labeled Position. Click in the Criteria row and type teacher. Then scroll over to the field labeled Age. Click in the Criteria row and type >30. The criteria for this Query is now set. You are asking Access to display all records for teachers who are over 30 years of age. It will sort them alphabetically by Last Name. Close your Query by clicking on the X. Access 2000 Level 1 Page 9
38. You will be asked if you want to save changes to your Query. Select Yes and this Save As window will appear. Name your Query Teacher >30. Click OK. 39. The main Database window will appear with the name of your Query in the window. Doubleclick on the query, teacher>30. Your query will open and the data will be displayed according to the criteria you entered. Notice the data is sorted by last name in ascending order. No records are present for any contacts who are 30 or under and are not teachers. Click X to close the query. Activity 7 Creating a Report An Access database sometimes contains large amount of information. The key to using a database efficiently is to be able to pull out just the data you need. A report allows the user to choose as much or as little of the data in the database and print or display it in a variety of formats. You may use the report feature in a number of ways. Examples: Birthday lists, telephone lists, address books, or data from a project identifying foods served in the cafeteria during a school year. The instructions below describe the steps to create a report. 40. Click on the Reports object button. Double-click on Create report by using wizard. 41. Select the fields you wish to display in your report. As before, the > button selects one field at a time and the >> button will select all fields. For this exercise, select the following fields (in order): Title, FirstName, LastName, Address, City, State, PostalCode. Choose Next. Access 2000 Level 1 Page 10
42. Choose Next at the grouping window. 43. The Report Wizard now asks how you want the data sorted when it is displayed in the report. Clicking on the, select LastName and then Next. The data will be sorted in ascending order. 44. Choose Tabular, Landscape and then Next. If Landscape is not chosen then the data will not be displayed properly. 45. The window below appears that prompts you to select a style. Click on one of the styles to preview them. Select Corporate as your choice. Then choose Next. Access 2000 Level 1 Page 11
46. Name the report Contacts Address Book. Be sure Preview the Report is checked. Select Finish. 47. The report will be displayed in the active window in the Print Preview mode. Select File and Print to print the report. It will be printed exactly as it is displayed. Close the report by clicking on the X in the upper right corner. Access 2000 Level 1 Page 12
Mailing labels can be created in the report format. Activity 8 Creating Mailing Labels 48. Click on Reports, then on New. 49. Click on Label Wizard Click on the u to select the table or query where the data needed to create the labels comes from. Select Contacts. 50. The Label Wizard window appears. Click on English. Click on uto select the manufacturer of the labels you are using. Select the correct Product Number from the list that appears. Click Next. Access 2000 Level 1 Page 13
51. Click the u to select the Font, Font Size, and Font weight. Click the button to the right of the Text Color box to change the font color. Click Next. You will see a sample of your font on the left. 52. Construct your label. Highlight the information you want to include on the label and and click > to move it to the prototype label. Put spaces where needed. Press Enter to go to a new line. Any information typed on the prototype will appear on all labels. Click Next when finished. 53. If you choose to, sort your labels by one or more fields. Highlight the field(s) to sort by and click > to move them over. Click Next. Access 2000 Level 1 Page 14
54. Name the report Contact Labels. Be sure See the labels as they will look printed is selected. Click Finish. 55. The report will be displayed in the active window in the Print Preview mode. Place your labels in the printer. Select File and Print to print the report. It will be printed exactly as it is displayed. Close the report by clicking the X in the upper right corner. Access 2000 Level 1 Page 15