Creating a Customized Database
Total Page:16
File Type:pdf, Size:1020Kb
U NIT 2 PROJECT CREATING A CUSTOMIZED DATABASE I N THIS PROJECT, YOU LEARN HOW TO ■ Examine a Database and Its ■ Add and Delete Records Objects ■ Create a Form Using the Form ■ Create Tables and Set Field Wizard Properties in Design View ■ Create a Report Using the Report ■ Create Relationships Wizard WHY WOULD I DO THIS? database is a collection of related facts—or data—stored together in one file. AMicrosoft Office Access is a computerized database management system that enables you to store, retrieve, analyze, and print information. It is a system for manag- ing large amounts of data. Companies use databases for many purposes: to manage cus- tomer files, to track orders and inventories, and for marketing purposes. An individual might set up a database to track household expenses or manage a list of family, friends, and business addresses. Teachers often set up a database to track students’ grades and other class information. A database enables the user to access and manage thousands of pieces of data in an organized, efficient, and accurate manner. To begin using Access, there are a number of terms that you need to understand. An Access database consists of tables, queries, forms, reports, pages, macros, and modules, which are all generally known as objects. These objects work together to store, search, input, report, and automate the data. The following is a brief explanation of the purpose of each object. ■ Tables are the foundation of the database because they store the data that makes up the database. Each table stores a set of related data. ■ Queries are used to sort, search, and limit the data to just those records that you want to see. ■ Forms are used to input, edit, or view data, generally one record at a time. ■ Reports are used to summarize information for printing and presentation of the data. ■ Pages are a type of Web page designed for viewing and working with data from the Internet or over an intranet. ■ Macros are used to automate existing Access commands. ■ Modules are programs in the Visual Basic programming language that are used to cus- tomize the database for special needs. In this project, you first examine the four main objects in a database: tables, forms, reports, and queries. Then you open another database, add a table, add records, and create a form and a report. Queries are covered in depth in Project 12. VISUAL SUMMARY In this project, you add objects to a database for the Armstrong Pool, Spa, and Sauna Company. You create an Orders table and enter new records. You create a Contractors form and a Contact List report. Figure 11.1 shows the form that you create, and Figure 11.2 shows the report. UNIT 2 2 Project 11 Creating a Customized Database Form created FIGURE 11.1 Report created FIGURE 11.2 LESSON 1: Examining a Database and Its Objects This textbook introduces you to the four main Microsoft Office Access objects: tables, forms, reports, and queries. Each object has at least two views. The Design view is used to create and mod- ify objects, whereas the object view is used to view the data. In tables or queries this is known as the Datasheet view, in a form it is the Form view, and in a report it is the Print Preview of the report. In this lesson, you open a database and save a backup copy of the database. You then open each of the four main objects to see the data and to examine the design of a table and a query. All of these exercises can be completed with Microsoft Office XP or later versions. Instructions throughout the lessons are based on the Windows XP operating system, running Microsoft Office 2003. Your screen may differ slightly from the figures shown, even if you are running Office 2003. To Examine the Database Window 1 Start Microsoft Access; click More on the Getting Started task pane under Open. The Open dialog box displays. As with other applications, use the Open dialog box to locate and open files. 2 Locate and open AC_1101 in the Student folder for this chapter. If necessary, click Open in the Security Warning box. The file opens and displays in the Access window. The Tables object button is selected and one table—Personnel—is listed. Lesson 1 Examining a Database and Its Objects 3 UNIT 2 If you have problems... The latest version of Windows has more sensitive security precautions than earlier ver- sions. Depending on your version of Windows and the security settings on your com- puter, you may see a Security Warning box every time you open an Access database. This warning box advises you that the file may not be safe to open if it contains code that was intended to harm your files. Because databases use objects that are intercon- nected and may contain macros, this security warning displays as a precaution. Macros in Access are used to manage files. The files that you use in this textbook are safe to open, so each time you see this security warning, click Open to continue. 3 Click File, Back Up Database on the menu bar. The Save Backup As dialog box displays. Here you can save the file with a new name and in a folder of your choice. 4 Navigate to the drive and folder where you are saving your files; in the File name box type Personnel and then click Save. Click Open in the Security Warning box if it displays. The original AC_1101 file remains on your screen. The Database window opens to the Tables object list. The Databas window is the command center from which you control and view all of the objects in your database. Notice that the Database window title bar displays the filename and (Access 2002-2003 file format). The file format refers to the version of Access that was used to create the file. 5 Examine Figure 11.3 to identify each component of the Database window and read the explanation for each part of the window found in Table 11.1 that fol- lows this exercise. Database window Database toolbar Database window toolbar Commands for creating a new table Objects bar Personnel is active object on the Tables object list FIGURE 11.3 6 Click the Close button on the AC_1101: Database title bar to close the file. Now that you have created a copy of the database, you will use that to complete the rest of this project. UNIT 2 4 Project 11 Creating a Customized Database TO EXTEND YOUR KNOWLEDGE... The Database window is the command center for selecting, creating, and viewing objects in your database. The Database window title bar displays the name of the database and the file format used to save the database. This window displays within the Access window when you are working with an Access file. It is important to know the names and functions of each part of this window. COMPONENT DESCRIPTION Database window A toolbar on the Database window used to view the data (Open button), toolbar view the Design (Design button), create a new object (New button), or Delete an object (Delete button). Change the way each object is listed by clicking the Large Icons, Small Icons, List, or Details buttons. Objects bar Used to navigate between objects. The currently active object displays in orange. The names of available objects for that type of object display to the right of the Objects bar. In Figure 11.3, Tables is the active object and Personnel is the only table that is listed for this database. Object list The objects for the currently active object. Database toolbar The toolbar at the top of the Microsoft Office Access window. The buttons on this toolbar and the name of the toolbar change depending on the object and view that is selected. Commands for Command lines display methods that can be used for creating a new object creating a new object for the object that is currently displayed. TABLE 11.1 In the first steps in this lesson you opened a database, created a backup copy of the database file, and identified the main elements of the Access window. This process is slightly different from the process used to create copies of Microsoft Office Word, Excel, and PowerPoint files. In each of those applications, you use the Save As command to create a copy of the file with another name, thus preserving the original file provided to you. The Save As command in Access is used to create copies of objects in the database, but not to create a copy of the entire database. Rather you use the File Backup command to create a backup copy of the database with another name. However, after this is done, the original file remains on the screen. Therefore, you have to close the original file and open the backup copy, which you named Personnel. In this portion of the les- son, you open the Personnel database file and explore each of the objects in the database. To Examine Database Objects 1 Open Access, if necessary. Click the Open button, and navigate to the folder in which you have saved your student work. Open the Personnel database file. If you have problems... Because this file is a copy of the AC_1101 file, it contains all of the elements of the original file. Therefore, a security warning box may display. Respond by clicking Open to display the Personnel database file. Lesson 1 Examining a Database and Its Objects 5 UNIT 2 2 Select Personnel on the Tables object list, and then click Open on the Database window toolbar.