Using Microsoft Access Databases Print this document to use as a reference while you work through this course. Open Access, and follow all directions to familiarize yourself with the program. Database Terminology Column Field Row Record Table Query Report Datasheet view Design view Form Data type Primary key Field properties Sort Ascending order Descending order Object Wizards A field The name assigned to a column A collection of fields A collection of related data items divided into fields A collection of related data arranged in rows and columns Extracts specific information based on specific criteria Printed format of data Data is entered in this view Allows you to create and/or edit your tables, queries, forms or reports Displays one record at a time The kind of data contained in a field, such as text, number, etc. Uniquely identifies a record and prevents duplication of a value in that field Assigns specifications to the field, such as number of characters, format, input mask, etc. Arranges data in ascending or descending order Data organized from low to high Data organized from high to low Separate component of a database, displayed on a separate tab in the database window, such as table, query, form, report Tools that walk you through step by step process of creating the objects of a database Creating a New Database: 1. Click START, PROGRAMS MICROSOFT OFFICE ACCESS 2003 (maroon key icon). 2. Click on CREATE NEW in the Task Pane. (or go to File, New in the menu bar.) 3. Click Blank Database in the Task Pane.
4. Unlike most programs, Access forces you to save the database before you start to work. Use the pull down arrow to select the folder or directory where you want to save the database and set the File Name. Click CREATE. The new database is created and a window appears with six tabs across the top. Now you are ready to create table and enter data. Creating a Table: 1. Click the TABLES button on the left side of the window. (This is the default so it may already be selected) 2. Click the Create table in Design View. 3. Enter the Field Names and select a Data Type for each field. (EX: Names= Data type text, SS#=Data Type Number) The following field types are available in Access. Text Use for text or combinations of text and numbers, such as addresses, or for numbers that do not require calculations, such as phone numbers, part numbers, or postal codes. Memo Use for lengthy text and numbers, such as notes or descriptions. Number Use for data to be included in mathematical calculations, except calculations involving money (use Currency type). Date/Time Use for dates and times. Currency Use for currency values and to prevent rounding off during calculations. AutoNumber Use for unique sequential (incrementing by 1) or random numbers that are automatically inserted when a record is added. Yes/No Use for data that can be only one of two possible values, such as Yes/No, True/False, On/Off. OLE Object Use for OLE objects (such as Microsoft Word documents, Microsoft Excel spreadsheets, pictures, sounds, or other binary data) that were created in other programs using the OLE protocol. Hyperlink Use for hyperlinks. A hyperlink can be a UNC path. Lookup Wizard Use to create a field that allows you to choose a value from another table or from a list of values using a combo box -choosing this option in the data type list starts a wizard to define this for you.
4. Click on the Datasheet view icon, or go to View in the Menu bar and select Datasheet View. You will be asked to save your table before you can change views. Adding Data to Your Table from Another Source: Data can be imported to Access from another source, such as Word, Excel or another spreadsheet or database program, to keep you from having to retype the data 1. Make sure you have a table created and all the fields set up. (The fields in your table must match the fields in your import data source.) The Database must be open but the Table must be closed. 2. Click on File in the menu bar. Select Get External Data, and then choose Import. 3. Change the file type to match the type of your other source. EX: Microsoft Excel (*.xls) or dbase III (*.dbf) or Text (*.txt) 4. Use the Look in: box to find your document. 5. Check the radio button bedside Delimited. Most data sources are separated by commas or tabs. 6. Click Next. 7. On the next screen you will see your choice of separators. The most common is Tab. If Tab is selected and you see lines between your columns, leave it that way. If not, click on the other separator types until you see the lines between your columns. 8. If your original data source had column headings (you will see them in the first row of data) make sure you check the box that says First Row Contains Column Headings. If the first row of your information is just data, then leave that box unchecked. 9. Click Next. 10. Select In An Existing Table, and select your table from the list. 11. Click Next. 12. Click Finish. 13. Open your table, and you should see the new data added to your table.
Creating a New Table by Importing Data from Another Source: You can also transfer data directly from another source into a new table if your field names are already set up in the original source. 1. Open the Access database or create a new one. 2. Make sure the TABLES tab is selected. 3. Click NEW. 4. Click IMPORT TABLE. 5. Click OK. 6. Change the file type to match the type of your other source. EX: Microsoft Excel (*.xls) or dbase III (*.dbf) or Text (*.txt) 7. Use the Look in: box to find your document. 8. Click IMPORT. 9. If you had column headings in your original document, select First Row Contains Column Headings. If not, leave that blank. Click NEXT. 10. Select IN A NEW TABLE, and Click NEXT. 11. On the next window you can set field names if you did not have them in your original document, or just check to make sure the field names are correct. Click NEXT. 12. If there is a unique number in your file (like a social security number or a serial number) set that as the primary key. If not, it is best to let Access assign a primary key. Click NEXT. 13. Set a name for your new table. Access automatically names the table the first few words of your original document, but this can become confusing. It is best to set a name that you will clearly recognize. Click FINISH. Creating Queries: A query pulls specific information from the tables. 1. Open the database. 2. Click on the Queries Tab at the top of the screen. 3. Click the NEW button on the right hand side. 4. Choose DESIGN VIEW and click OK. 5. Click on the name of the table you want to query and then click the ADD button. 6. Click CLOSE. 7. In thetable window, double click on each of the field you want to include in your query. This will place those items in the columns of your query design. (You can also drag single items down, or hold CTRL and select multiple items)
8. In the criteria row, type the piece of information you are looking for. (EX: In a field listing the department someone works in, typing the department name for the criteria will give you a list of ONLY the people in that department.) Criteria determines what you are querying. Run icon displays the results of the query. Show box allows a field to be part of the query, but not show in the results. 9. Click on the Run icon (exclamation point). This displays the results of your query. 10. Click FILE/CLOSE. You will get a message asking if you want to save changes to the design of the query. Click YES. 11. A save as screen will appear. In the query name box, type a name for the query. Click OK. This lists your query on the query window in your database. You can go back to your query at any time, and you can add as many queries as you like to search the data based on different criteria. If you add information to the Table, that new data will automatically appear in any queries for which it meets the criteria. Creating Mailing Labels: Access has a built in function that creates labels from the information in your database. You can use the address fields to create mailing labels, but you can also use this feature to create labels based on any of the information in the database. 1. Click on the Reports button on the left side of the database window. 2. Click the NEW button at the top of the screen. 3. Choose LABEL WIZARD from the list of options. 4. Use the pull down box to select the table or query from which you want to print. 5. Click OK.
6. On the next screen you will have the option of choosing the size and type of labels you will be printing to. 7. Click NEXT. 8. The next screen allows you to choose the font, size, style and color of the type for your labels. Click NEXT. 9. In the Available Fields box on the left, click on the first field you want to appear on your labels and then click the arrow pointing right. Be sure to put a space or return between items. Repeat as needed until all fields are added to your label. This will move those fields to the Prototype Label box on the right, arranged as you want them. 10. Click NEXT. 11. If you want your labels sorted by a particular field (ex: last name) double click on that field in the Available Fields box on the left. This will move the field to the Sort By box on the right, and sort your labels alphabetically by last name. You could sort by zip instead if you were doing a bulk mailing. 12. Click NEXT. 13. Access automatically assigns a name to your report based on the table or query name the report is from. You may type a new name for your report if you wish. Click FINISH. 14. If you want to make changes to the design of your labels report, click VIEW and select DESIGN VIEW. This will allow you to change colors, fonts, sizes, placement, etc. Creating A Report: 1. Click on the Reports button on the left side of the data base window. 2. Click the NEW button on the right hand side of the screen. 3. Choose REPORT WIZARD from the list. 4. Select the name of your table from the pull down box. 5. Click OK. 6. Use the single arrow to select the fields you want to include in your report, or click the double arrow to select all fields. Click NEXT.
7. On the next screen, you can set up the report to sort by different levels. EX: if you want to sort by Teacher, click TEACHER in the field name list and click the arrow button and then click LOCATION and the arrow button. This will move Teacher to the top left, and Location will be indented below it. 8. Click NEXT. 9. The next screen allows you to sort by any of the fields Click NEXT. 10. Choose a format for your report (Stepped is most common) and select the orientation. For a report with many fields, you probably want to choose landscape. Make sure the Adjust the field width so all fields fit on a page box is checked. Click NEXT. 11. Choose a style for your report. When you click on a style in the list, an example will appear. Click NEXT. 12. Give your report a name. Access automatically names the report the same name as the table it was created from, which can be confusing. You might want to give it a name based on the sort you applied. Make sure that Preview the report is selected. 13. Click FINISH. 14. If you want to make changes to the design of your report, click VIEW and select DESIGN VIEW. This will allow you to change colors, fonts, placement, etc. Creating a Form: 1. Click on the Forms Tab at the top of your database screen. 2. Click the NEW button on the right hand side of the screen. 3. Choose Form Wizard from the list. 4. Choose your table name from the pull down list. 5. Click OK.
6. Use the single arrow to select the fields you want to include in your form, or click the double arrow to select all fields. Click NEXT. 7. Choose a format for your form. (Columnar is usually easiest to follow) Click NEXT. 8. Choose a style for your form. As you click on a style and example will appear. Click NEXT. 9. Type a Name for your form. Access automatically names it the same name as your table, and this can be confusing. It is best for you to name it something you will recognize. Make sure that open form is selected. Click FINISH. 10. To make changes to your form, click VIEW and select DESIGN VIEW. This will allow you to change colors, fonts, placement, etc. If you change the order of the items on your form, you will change the tab order. To correct this, right click on the form, select TAB ORDER from the pop up list, and drag the items into the new order.