Chapter 17: Searching, Sorting, and Querying a Database 333 4. Click in the Find What text box and type in the data you know is stored in the record you want to find. For example, if you want to find the phone number of a person but you know only that person’s last name, you type that person’s last name in the Find What text box. 5. Click the Look In list box and choose the name of the entire database table. 6. (Optional) Click in the Match list box and choose one of the following: • Any Part of Field: The Find What text can appear in any part of a field. • Whole Field: The Find What text is the only text stored in a field. • Start of Field: The Find What text can be only at the beginning of a field. 7. (Optional) Click in the Search list box and choose one of the following: • Up: Searches from the record where the cursor appears, up to the beginning of the database table • Down: Searches from the record where the cursor appears, down to the end of the database table • All: Searches the entire database table 8. Click Find Next. Access highlights the field where it finds the text you typed in Step 4. 9. Repeat Step 8 to search for more records that might contain the text you typed in Step 4. 10. Click Cancel or the Close button. Filtering a database Searching a database is easy but somewhat limited because you can retrieve only a record that matches any text that you want to find. If you want to find multiple records, you can use a filter. A filter lets you tell Access to display only those records that meet a certain criteria, such all records that contain people who earn more than $200,000 a year, are currently married, live in Las Vegas, Nevada, and own two or more cars. To filter a database table, you must tell Access which field to use as a filter, and then you must define the criteria for that filter. For example, if you want to filter your database table to see only those records listing the names of people who are at least 65, you filter the Age field and set the criteria to Greater than or equal to 65.
334 Part VI: Storing Stuff in Access Filtering simply hides all records in a database table that don’t match your criteria. Filtering doesn’t delete or erase any records. Using an exact match for a filter The simplest filtering criterion searches for an exact match. When you filter a field by an exact match, you’re telling Access, “I want to see only those records that contain this specific chunk of data in this particular field.” By using an exact match filter, you could display only those records that contain CA in the State field. To filter a database table, follow these steps: 1. In the All Tables pane on the left of the screen, double-click the name of the database table you want to filter. Access displays the Datasheet view of your database. 2. Click the Home tab. 3. Click in the field (column) that you want to use as a filter. 4. Click the Filter icon in the Sort & Filter group. A pop-up menu appears, as shown in Figure 17-2. Figure 17-2: The Filter pop-up menu lets you specify the criteria for a specific field.