SECTION 3
Lesson 3.4: Sorting And Filtering Data

   

 

 

If you are familiar with word processing and spreadsheet programs, you are probably familiar with find and replace commands. Even Internet browsers feature a find command. These commands are designed to search a document of any size quickly to find instances of a certain keyword or value and, if applicable, modify it.

You can use the find and replace commands on every database object except reports (which are really just documents to be printed), macros (a collection of commands, no actual data), and modules (another sequence of commands, again no actual data).

To demonstrate the find and replace functionality, open the Customers table in the Northwind Sample Database. Click Edit à Find. The Find and Replace dialog box will open:

 

 

Find What

The Find What field lets you type in a certain word, part of a word, or number. The keywords of any previous searches you have performed will appear if you click the pull-down arrow.

Look In

The Look In field lets you search just the primary key of the table or the entire current database object.

Match

If you are not 100% sure what you are looking for but at least have an idea, you can use different options in the Match field.

Search

The Search field lets you conduct your search up, down, or all over the current object. For example, if you are looking for a particular name that starts with ‘T’ in a very large database, you can save a lot of search time by searching at the fields that start with T instead of the whole alphabet.

Match Case

If you are looking for a certain organization name or something that is in all uppercase letter, you can have Access ignore all lower case entries in its search which can increate the speed of searching.

Search Fields as Formatted

Imagine you want to search for a record containing a particular date, and you type April 25, 2004. If this box is checked, Access will search for all formats of this date, like 04/25/2004, 04/25/04, 25/04/04, 2004/25/04 and so on. Searching with this box checked will slow down certain searches, but is more likely to find the data you need.

 

If we wanted to search for London in the Customers table, we would type London in the Find What box and select Customers:Table from the Look In combo box. Click the Find Next button when ready to search:

 

 

Every match (or possible match, depending on your search criteria) will be highlighted as Access searches the document:

 

 

To use the replace function, click the Replace tab in the Find and Replace dialog box. The controls are exactly the same, only with a bit more functionality:

 

 

If you have spelled something wrong, or want to change the name of an organization to an acronym, type the word or number you want to be substituted in the Replace With box.

Click the Find Next button to find the next instance of a certain keyword or number. You can click the Replace button to replace this instance with your new word or number, or if you are confident you want to change all instances of something, click the Replace All button.