Chapter 28.  Mastering the Datasheet

In Chapter 26, you took your first look at the datasheet—a straightforward way to browse and edit the contents of a table. As you’ve learned since then, the datasheet isn’t the best place to build a table. (Design view’s a better choice for database control freaks.) However, the datasheet is a great tool for reviewing the records in your table, making edits, and inserting new data.

Based on your experience creating the Dolls table ( Creating a Simple Table), you probably feel pretty confident breezing around the datasheet. However, most tables are considerably larger than the examples you’ve seen so far. After all, if you need to keep track of only a dozen bobbleheads, then you really don’t need a database—you’ll be just as happy jotting the list down in any old spreadsheet, word processor document, or scrap of unused Kleenex.

On the other hand, if you plan to build a small bobblehead empire (suitable for touring in international exhibitions), you need to fill your table with hundreds or thousands of records. In this situation, it’s not as easy to scroll through the mass of data to find what you need. All of a sudden, the datasheet seems more than a little overwhelming.

Fortunately, Access is stocked with datasheet goodies that can simplify your life. In this chapter, you’ll become a datasheet expert, with tricks like sorting, searching, and filtering at your fingertips. You’ll also learn a quick-and-dirty way to print a snapshot of the data in your table.

Note

It’s entirely up to you how much time you spend using datasheets. Some Access experts prefer to create forms for all their tables (as described in Chapter 33). With forms, you can design a completely customized window for data entry. Designing forms takes more work, but it’s a great way to satisfy your inner Picasso.

Datasheet Customization

Getting tired of the drab datasheet, with its boring stretch of columns and plain text? You can do something about it. Access lets you tweak the datasheet’s appearance and organization to make it more practical (or suit it to your peculiar sense of style). Some of these customizations—like modifying the datasheet font—are shameless frills. Other options, like hiding or freezing columns, can genuinely make it easier to work with large tables.

Note

Access doesn’t save formatting changes immediately (unlike record edits, which it stores as soon as you make them). Instead, Access prompts you to save changes the next time you close the datasheet. You can choose Yes to keep your customizations or No to revert to the table’s last look and feel (which doesn’t affect any edits you’ve made to the data in that table).

Formatting the Datasheet

Access lets you format the datasheet with eye-catching colors and fonts. Do these options make any difference to the way the datasheet works? Not really. But if your computer desktop looks more like a ’60s revival party than an office terminal, then you’ll enjoy this feature.

To find the formatting features, look at the ribbon’s Home → Font section (see Figure 28-1).

The Home → Font section lets you change the text font and colors in the entire datasheet. The most practical frill is the ability to turn off some or all of the gridlines and use alternating row colors to highlight every other row, as shown here.

Figure 28-1. The Home → Font section lets you change the text font and colors in the entire datasheet. The most practical frill is the ability to turn off some or all of the gridlines and use alternating row colors to highlight every other row, as shown here.

Every formatting change you make affects the entire table. You may think it’s a nifty idea to apply different formatting to different columns, but Access doesn’t let you. If this limitation’s frustrating you, be sure to check out forms and reports later in this book. Both are more complicated to set up, but give you more formatting power.

Note

There’s one other way you can use the ribbon’s Home → Font section. If you have a field that uses the Memo data type and you’ve set your field to use rich text ( Formatted text), then you can select some text inside your field, and change its formatting using the ribbon.

Rearranging Columns

The fields in the datasheet are laid out from left to right, in the order you created them. Often, you’ll discover that this order isn’t the most efficient for data entry.

Imagine you’ve created a Customers table for a novelty pasta company. When a new customer registration ends up on your desk, you realize that the registration form starts with the name and address information, and then includes the customer’s pasta preferences. Unfortunately, the fields on the datasheet are laid out in a completely different order. From right to left, they’re arranged like this: ID, FreshPastaPreference, DriedPastaPreference, FirstName, LastName, Street, City, State, Country. (This organization isn’t as crazy as it seems—it actually makes it easier for the people filling pasta orders to quickly find the information they want.) Because of this ordering, you need to skip back and forth just to enter the information from a single registration.

Fortunately, you can solve this problem without redesigning the table. Drag the columns you want to move to new positions, as shown in Figure 28-2.

The best part of this approach is that you don’t need to modify the database’s actual structure. If you switch to Design view after moving a few columns, you’ll see that the field order hasn’t changed. In other words, you can keep the exact same physical order of fields (in your database file) but organize them differently in Datasheet view.

To move a column, click the column header once to select that column. Then, drag the column header to its new location. In this example, the FirstName field is about to be relocated so that it’s just before the FreshPastaPreference field.

Figure 28-2.  To move a column, click the column header once to select that column. Then, drag the column header to its new location. In this example, the FirstName field is about to be relocated so that it’s just before the FreshPastaPreference field.

Tip

Rearranging columns is a relatively minor change. Don’t worry about shifting columns around to suit a specific editing job and then switching them back later on. Your changes don’t affect the data in the database. If you want to use a particular column order for a one-time job, simply refrain from saving your changes when you close the datasheet.

Resizing Rows and Columns

As you cram more and more information into a table, your datasheet becomes wider and wider. In many cases, you’ll be frustrated with some columns hogging more space than they need and others being impossibly narrow.

As you’d expect, Access lets you tweak column widths. But you probably haven’t realized how many different ways you can do it:

  • Resize a single column. Move the mouse to the column’s right edge. Drag to the left (to shrink the column) or to the right (to make it larger).

  • Resize a column to fit its content. Double-click the column edge. Access makes the column just wide enough to fit the field name or the largest value (which-ever’s larger). However, it doesn’t make the column so wide that it stretches beyond the bounds of the window.

  • Resize several adjacent columns. Drag the first column’s header across the columns until you’ve selected them all. Then, drag the right edge of your selection to the left or the right. All the selected columns shrink or expand to fit the available space, sharing it equally.

  • Resize a column with pinpoint accuracy. Right-click the column header, and then choose Column Width. You’ll see the Column Width dialog that lets you set an exact width as a number (Figure 28-3).

The Column Width dialog box lets you set an exact width as a number. (The number doesn’t actually have a concrete meaning—it’s supposed to be a width in characters, but because modern Access uses proportional fonts, different characters are different sizes.) You can also turn on the Standard Width checkbox to reset the width to the standard narrow size, or click Best Fit to expand the column to fit its content (just as when you double-click the edge of the column).

Figure 28-3.  The Column Width dialog box lets you set an exact width as a number. (The number doesn’t actually have a concrete meaning—it’s supposed to be a width in characters, but because modern Access uses proportional fonts, different characters are different sizes.) You can also turn on the Standard Width checkbox to reset the width to the standard narrow size, or click Best Fit to expand the column to fit its content (just as when you double-click the edge of the column).

Note

Remember, a column doesn’t need to be wide enough to show all its data at once. You can scroll through a lengthy text field using the arrow keys, and if that’s too awkward, use the Shift+F2 shortcut to show the full contents of the current field in a Zoom box.

Just as you can resize columns, you can also resize rows. The difference is that Access makes sure all rows have the same size. So when you make one row taller or shorter, Access adjusts all the other rows to match.

You’ll mainly want to shrink a row to cram more rows into view at once. You’ll want to enlarge a row mostly to show more than one line of text in each text field (see Figure 28-4).

If a row’s large enough, Access wraps the text inside it over multiple lines, as shown here with the Description column.

Figure 28-4. If a row’s large enough, Access wraps the text inside it over multiple lines, as shown here with the Description column.

Hiding Columns

Many tables contain so many columns that you can’t possibly fit them all into view at the same time. This quality’s one of the drawbacks to the datasheet, and often you have no choice but to scroll from side to side.

However, in some situations, you may not need to see all the fields at once. In this case, you can temporarily hide the columns that don’t interest you, thereby homing in on the important details without distraction. Initially, every field you add to a table is out in the open.

To hide a column, select the column by clicking the column header. (You can also select several adjacent columns by clicking the column header of the first, and then dragging the mouse across the rest.) Then, right-click your selection, and then choose Hide Columns. The column instantly vanishes from the datasheet. (This sudden disappearance can be a little traumatic for Access newbies.)

Fortunately, the field and all its data remain just out of sight. To pop the column back into view, right-click any column header and choose Unhide Columns. Access then shows the Unhide Columns dialog box (Figure 28-5).

Using the Unhide Columns dialog box, you can choose to make hidden columns reappear, and (paradoxically) you can hide ones that are currently visible. Every column that has a checkmark next to it is visible—every column that doesn’t is hidden. As you change the visibility, Access updates the datasheet immediately. When you’re happy with the results, click Close to get back to the datasheet.

Figure 28-5. Using the Unhide Columns dialog box, you can choose to make hidden columns reappear, and (paradoxically) you can hide ones that are currently visible. Every column that has a checkmark next to it is visible—every column that doesn’t is hidden. As you change the visibility, Access updates the datasheet immediately. When you’re happy with the results, click Close to get back to the datasheet.

Note

At the bottom of the field list, you’ll see an entry named Add New Field. This “field” isn’t really a field—it’s the placeholder that appears just to the right of your last field in Datasheet view, which you can use to add new fields (Organizing and Describing Your Fields). If you’re in the habit of adding fields using Design view (Design View), then you can hide this placeholder to free up some extra space.

If you add a new record while columns are hidden, you can’t supply a value for that field. The value starts out either empty or with the default value (if you’ve defined one for that field, as described on Setting Default Values). If you’ve hidden a required field (Preventing Blank Fields), you receive an error message when you try to insert the record. All you can do is unhide the appropriate column, and then fill in the missing information.

Freezing Columns

Even with the ability to hide and resize columns, you’ll probably need to scroll from side to side in a typical datasheet. In this situation, you can easily lose your place. You might scroll to see more information in the Contacts table, but then forget exactly which person you’re looking at. Access has one more feature that can help you by making sure important information is always visible—frozen columns.

A frozen column remains fixed in place at the Access window’s left side at all times. Even as you scroll to the right, all your frozen columns remain visible (Figure 28-6). To freeze a column (or columns), select them, right-click the column header, and then choose Freeze Columns.

Tip

If you want to freeze several columns that aren’t next to each other, start by freezing the column that you want to appear at the very left. Then, repeat the process to freeze the column that you want to appear just to the right of the first column, and so on.

Top: In this example, the FirstName and LastName field are frozen. They appear initially at the left. (The ribbon’s collapsed in this figure to make more room, as described on .)Bottom: When you scroll to the side to see more information, the FirstName and LastName columns stay put.

Figure 28-6.  Top: In this example, the FirstName and LastName field are frozen. They appear initially at the left. (The ribbon’s collapsed in this figure to make more room, as described on Managing Database Objects.) Bottom: When you scroll to the side to see more information, the FirstName and LastName columns stay put.

Frozen columns must always be positioned at the left size of the datasheet. If you freeze a column that’s somewhere else, Access moves it to the left side and then freezes it. You can move it back after you unfreeze the column using the column reordering trick on Rearranging Columns. Keep in mind that while a column’s frozen, you can’t rag it to a different place.

To unfreeze columns, right-click a column header, and then choose Unfreeze All Columns.

Note

Eventually, you’ll discover that the customizations provided by the datasheet aren’t enough, or you’ll need to customize the same table different ways for different people. These signs tell you that you need to step up to forms, a more advanced data display option described in Chapter 33.

Datasheet Navigation

In Chapter 26, you learned the basics of moving around the datasheet. Using your mouse and a few select keystrokes, you can cover a lot of ground. (Flip back to Shortcut keys for a review of the different keys you can use to jump from place to place and perform edits.)

However, you haven’t seen a few tricks yet. One’s the timesaving record navigation buttons at the bottom of the datasheet (Figure 28-7).

You could easily overlook the navigation buttons at the bottom of the datasheet. These buttons let you jump to the beginning and end of the table, or, more interestingly, head straight a record at a specific position. To do this, type the record number (like “4”) into the box (where it says “3 of 6” in this example), and then hit Enter. Of course, this trick works only if you have an approximate idea of where in the list your record’s positioned.

Figure 28-7. You could easily overlook the navigation buttons at the bottom of the datasheet. These buttons let you jump to the beginning and end of the table, or, more interestingly, head straight a record at a specific position. To do this, type the record number (like “4”) into the box (where it says “3 of 6” in this example), and then hit Enter. Of course, this trick works only if you have an approximate idea of where in the list your record’s positioned.

Several more datasheet features help you orient yourself when dealing with large amounts of data, including sorting (which orders the records so you can see what you want), filtering (which cuts down the data display to include only the records you’re interested in), and searching (which digs specific records out of an avalanche of data). You’ll try all these features out in the following sections.

Sorting

In some cases, you can most easily make sense of a lot of data by putting it in order. You can organize a customer list by last name, a product catalog by price, a list of wedding guests by age, and so on.

To sort your records, pick a column you want to use to order the records. Click the drop-down arrow at the right edge of the column header, and then choose one of the sort options at the top of the menu (see Figure 28-8).

Depending on the data type of field, you’ll see different sorting options, as explained in Table 28-1. (You can also apply the same types of sort using the commands in the ribbon’s Home → Sort & Filter section.)

In an unsorted table, records are ordered according to when they were created, so that the oldest records are at the top of the datasheet, and the newest at the bottom. Sorting doesn’t change how Access stores records, but it does change the way they’re displayed.

Tip

Use the Home → Sort & Filter → Clear All Sorts command to return your table to its original, unsorted order.

This text field gives you the choice of sorting alphabetically from the beginning of the alphabet (A to Z) or backward from the end (Z to A). The menu also provides filtering options, which are described on .

Figure 28-8.  This text field gives you the choice of sorting alphabetically from the beginning of the alphabet (A to Z) or backward from the end (Z to A). The menu also provides filtering options, which are described on Quick filters.

Table 28-1. Sorting Options for Different Data Types

Data Type

Sort Options

Description

Text, Memo, and Hyperlink

Sort A to Z

Sort Z to A

Performs an alphabetic sort (like the dictionary), ordering letter by letter. The sort isn’t case-sensitive, so it treats “baloney” and “Baloney” the same.

Number, Currency, and AutoNumber

Sort Smallest to Largest

Sort Largest to Smallest

Performs a numeric sort, putting smaller numbers at the top or bottom.

Date/Time

Sort Oldest to Newest

Sort Newest to Oldest

Performs a date sort, distinguishing between older dates (those that occur first) and more recent dates.

Yes/No

Sort Selected to Cleared

Sort Cleared to Selected

Separates the selected from the unselected values.

Sorting is a one-time affair. If you edit values in a sorted column, then Access doesn’t reapply the sort. Imagine you sort a list of people by FirstName. If you then edit the FirstName value for one of the records, changing “Frankie” to “Chen,” Access doesn’t relocate the row to the C section. Instead, the changed row remains in its original place until you resort the table. Similarly, any new records you add stay at the end of the table until the next sort (or the next time the table is opened). This behavior makes sense. If Access relocated rows whenever you made a change, you’d quickly become disoriented.

Note

The sorting order’s one of the details that Access stores in the database file. The next time you open the table in Datasheet view, Access automatically applies your sort settings.

Sorting on multiple fields

If a sort finds two duplicate values, there’s no way to know what order they’ll have (relative to one another). If you sort a customer list with two “Van Hauser” entries in it, then you can guarantee that sorting by last name will bring them together, but you don’t know who’ll be on top.

If you want more say in how Access treats duplicates, then you can choose to sort based on more than one column. The traditional phone book, which sorts people by last name and then by first name, is a perfect example of this. People who share the same last name are thus grouped together and ordered according to their first name, like this:

Smith, Star
Smith, Susan
Smith, Sy
Smith, Tanis

In the datasheet, sorts are cumulative, which means you can sort based on several columns at the same time. The only trick’s getting the order right. The following steps take you through the process:

  1. Choose Home → Sort & Filter → Clear All Sorts.

    Access reverts your table to its original, unsorted order.

  2. Use the drop-down column menu to apply the sub-sort that you want for duplicates.

    If you want to perform the phone book sort (names are organized by last name, then first name), you need to turn on sorting for the FirstName field. Sorting explains the sorting options you’ll see, depending on the data type.

  3. Use the drop-down column menu to apply the first level sort.

    In the phone book sort, this is the LastName field.

You can extend these steps to create sorts on more fields. Imagine you have a ridiculously large compendium of names that includes some people with the same last and first name. In this case, you could add a third sort—by middle initial. To apply this sort, you’d switch sorting on in this order: MiddleInitial, FirstName, LastName. You’ll get this result:

Smith, Star
Smith, Susan K
Smith, Susan P
Smith, Sy

Filtering

In a table with hundreds or thousands of records, scrolling back and forth in the datasheet is about as relaxing as a pneumatic drill at 3:00 a.m. Sometimes, you don’t even need to see all the records at once—they’re just a finger-tiring distraction from the data you’re really interested in. In this case, you should cut the datasheet down to just the records that interest you, with filtering.

In order to filter records, you specify a condition that record must meet in order to be included in the datasheet. For example, an online store might pick out food items from a full product catalog, a shipping company might look for orders made last week, and a dating service might hunt down bachelors who don’t live with their parents. When you apply a filter condition, you end up hiding all the records that don’t match your requirements. They’re still in the table—they’re just tucked neatly out of sight.

Access has several different ways to apply filters. In the following sections, you’ll start with the simplest, and then move on to the more advanced options.

Quick filters

Aquick filter lets you choose what values you want to include and which ones you want to hide, based on the current contents of your table. To apply a quick filter, choose the column you want to use, and then click the drop-down arrow at the column header’s right edge. You’ll see a list of all the distinct values in that column. Initially, each value has a checkmark next to it. Clear the checkmark to hide records with that value. Figure 28-9 shows an example where a sort and filter are being used at the same time.

This list of eligible bachelors is sorted first by height (in descending largest-to-smallest order), and then filtered to include only those hopefuls who live in the state of New York. A checkmark indicates that records that have this value are included in the datasheet. Others are hidden from view.

Figure 28-9. This list of eligible bachelors is sorted first by height (in descending largest-to-smallest order), and then filtered to include only those hopefuls who live in the state of New York. A checkmark indicates that records that have this value are included in the datasheet. Others are hidden from view.

Note

To remove all the filters on a column (and show every record in the datasheet), click the dropdown button at the right edge of the column header, and then choose “Clear filter.”

Not all data types support filtering. Data types that do include Number, Currency, AutoNumber, Text, Hyperlink, Date/Time, and Yes/No. Memo fields don’t support quick filters (because their values are typically too large to fit in the dropdown list), but they do support other types of filters.

You can apply quick filters to more than one column. The order in which you apply the filters doesn’t matter, as all filters are cumulative, which means you see only records that match all the filters you’ve set. You can even use quick filters in combination with the other filtering techniques described in the following sections. To remove your filters, choose Home → Sort & Filter → Remove Filter.

Tip

Quick filters work best if you have a relatively small number of distinct values. Limiting people based on the state they live in is a great choice, as is the political party they support or their favorite color. It wouldn’t work as well if you wanted to cut down the list based on birth date, height, or weight, because there’s a huge range of different possible values. (You don’t need to give up on filtering altogether—rather, you just need to use a different type of filter.)

Filter by selection

Filter by selection lets you apply a filter based on any value in your table. This choice is handy if you’ve found exactly the type of record you want to include or exclude. Using filter by selection, you can turn the current value into a filter without hunting through the filter list.

Here’s how it works. First, find the value you want to use for filtering in the datasheet. Right-click the value, and then choose one of the filter options at the end of the menu (see Figure 28-10).

All data types that support filtering allow you to filter out exact matches. But many also give you some additional filtering options in the right-click menu. Here’s what you’ll see for different data types:

  • Text-based data types. You can filter values that match exactly, or values that contain a piece of text.

  • Numeric data types. You can filter values that match exactly, or numbers that are smaller or larger than the current number.

  • Date data types. You can filter values that match exactly, or dates that are older or newer than the current date.

Finally, to get even fancier, you can create a filter condition using only part of a value. If you have the value “Great at darts” in the Description field in your table of hopeful bachelors, you can select the text “darts,” and then right-click just that text. Now you can find other fields that contain the word “darts.” This utility is what gives the filter “by selection” feature its name.

Depending on the data type, you see slightly different filtering options. For a text field (like the City field shown here), you have the option to include only the records that match the current value (Equals “Chicago”), or those that don’t (Does Not Equal “Chicago”). You also have some extra filtering options that go beyond what a quick filter can do— namely, you can include or exclude fields that simply contain the text “Chicago.” That filter condition applies to values like “Chicagoland” and “Little Chicago.”

Figure 28-10.  Depending on the data type, you see slightly different filtering options. For a text field (like the City field shown here), you have the option to include only the records that match the current value (Equals “Chicago”), or those that don’t (Does Not Equal “Chicago”). You also have some extra filtering options that go beyond what a quick filter can do— namely, you can include or exclude fields that simply contain the text “Chicago.” That filter condition applies to values like “Chicagoland” and “Little Chicago.”

Access makes it easy to switch filtering on and off at a moment’s notice. Figure 28-11 shows how.

Right next to the navigation controls at the bottom of your datasheet is a Filtered/Unfiltered indicator that tells you when filtering’s applied. You can also use this box to quickly switch your filter on and off—clicking it once removes all filters, and clicking it again reapplies the most recent set of filters.

Figure 28-11. Right next to the navigation controls at the bottom of your datasheet is a Filtered/Unfiltered indicator that tells you when filtering’s applied. You can also use this box to quickly switch your filter on and off—clicking it once removes all filters, and clicking it again reapplies the most recent set of filters.

Filter by condition

So far, the filters you use have taken the current values in your table as a starting point. But if you’re feeling confident with filters, you may be ready to try a more advanced approach: filtering by condition. When you use a filter by condition, you can define exactly the filter you want.

Imagine you want to find all the rare wine vintages in your cellar with a value of more than $85. Using the filter-by-selection approach, you need to start by finding a wine with a value of $85, which you can use to build your condition. But what if there isn’t any wine in your list that has a price of exactly $85, or what if you just can’t seem to find it? A quicker approach is defining the filter condition by hand.

Here’s how it works. First, click the drop-down arrow at the right edge of the column header. But instead of choosing one of the quick filter options, look for a submenu with filtering options. This menu’s named according to the data, so text fields include a Text Filters option, number fields have a Number Filters option, and so on. Figure 28-12 shows an example.

Top: With a numeric field like this PurchasePrice field, filtering by condition lets you look at values that fall above a certain minimum.Bottom: Once you’ve chosen the type of filter you want, you need to supply the information for that filter. If you choose Greater Than, then you need to supply the minimum number. Records that are equal to or larger than this value are shown in the datasheet.

Figure 28-12. Top: With a numeric field like this PurchasePrice field, filtering by condition lets you look at values that fall above a certain minimum. Bottom: Once you’ve chosen the type of filter you want, you need to supply the information for that filter. If you choose Greater Than, then you need to supply the minimum number. Records that are equal to or larger than this value are shown in the datasheet.

Here’s a quick overview that describes the extra options you get using filter by condition, depending on your data type:

  • Text-based data types. All the same options as filter by selection, plus you can find values that start with specific text, or values that end with certain text.

  • Numeric data types. All the same options as filter by selection, plus you can find values that are in a range, meaning they’re greater than a set minimum but smaller than a set maximum.

  • Date data types. All the same options as filter by selection, plus you can find dates that fall in a range, and you can chose from a huge list of built-in options, like Yesterday, Last Week, Next Month, Year to Date, First Quarter, and so on.

Searching

Access also provides a quick search feature that lets you scan your datasheet for specific information. Whereas filtering helps you pull out a batch of important records, searching’s better if you need to find a single detail that’s lost in the mountains of data. And while filtering changes the datasheet view by hiding some records, searching leaves everything as is. It just takes you to the data you want to see.

The quickest way to search is through the search box next to the record navigation controls (see Figure 28-13). Just type in the text you want to find. As you type, the first match in the table is highlighted automatically. You can press Enter to search for subsequent matches.

Here, a search is being performed for the word “bobblehead.” If you find a match, you can keep searching—just press Enter again to jump to the next match. In this example, pressing Enter sends Access to the next record’s Description field.

Figure 28-13. Here, a search is being performed for the word “bobblehead.” If you find a match, you can keep searching—just press Enter again to jump to the next match. In this example, pressing Enter sends Access to the next record’s Description field.

When performing a search, Access scans the table starting from the first field in the first record. It then goes left to right, examining every field in the current record. If it reaches the end without a match, then it continues to the next record and checks all of its values, and so on. When it reaches the end of the table, it stops.

If you want to change the way Access performs a search, you’ll need to use the Find feature instead:

  1. Choose Home → Sort & Filter → Find. (Or, just use the shortcut Ctrl+F.)

    The Find and Replace dialog box appears Figure 28-14).

    The Find and Replace dialog box is the perfect tool for hunting for lost information.

    Figure 28-14. The Find and Replace dialog box is the perfect tool for hunting for lost information.

  2. Specify the text you’re searching for in the Find What box, and then set any other search options you want to use:

    • Find What. The text you’re looking for.

    • Look In. Allows you to choose between searching the entire table or just a single field.

    • Match. lets you specify whether values need to match exactly. Use Whole Field to require exact matches. Use Start of Field if you want to match beginnings (so “bowl” matches “bowling”), or Any Part of Field if you want to match text anywhere in a field (so “bowl” matches “League of extraordinary bowlers”).

    • Search. Sets the direction Access looks: Up, Down, or All (which loops from the end of the table to beginning, and keeps going until it has traversed the entire table).

    • Match Case. If selected, finds only matches that have identical capitalization. So “banana” doesn’t match “BANANA.”

    • Search Fields as Formatted. If selected, means Access searches the value as it appears on the datasheet. For example, the number 44 may appear in a Currency field as $44.00. If you search for 44, you always find what you’re looking for. But if you search for the formatted representation $44.00, you get a match only if you have Search Fields as Formatted switched on. In extremely large tables (with thousands of records), searches may be faster if you switch off Search Fields as Formatted.

    Note

    In order to turn off Search Fields as Formatted, you must choose to search a single field in the Look In box. If you are searching the entire table, then you must search the formatted values.

  3. Click Find Next.

    Access starts searching from the current position. If you’re using the standard search direction (Down), Access moves from left to right in the current record, and then down from record to record until it finds a match.

    When Access finds a match, it highlights the value. You can then click Find Next to look for the next match, or Cancel to stop searching.

Printing the Datasheet

If you want to study your data at the dinner table (and aren’t concerned about potential conflicts with non-Access-lovers), nothing beats a hard copy of your data. You can dash off a quick printout by choosing File → Print from the menu while your datasheet’s visible. However, the results you get will probably disappoint you, particularly if you have a large table.

The key problem’s that Access isn’t bothered about tables that are too wide to fit on a printed page. It deals with them by splitting the printout into separate pages. If you have a large table and you print it out using the standard Access settings, you could easily end up with a printout that’s four pages wide and three pages long. Assembling this jigsaw is not for the faint of heart. To get a better printout, it’s absolutely crucial that you preview your table before you print it, as described in the next section.

Print Preview

The print preview feature in Access gives you the chance to tweak your margins, paper orientation, and so on, before you send your table to the printer. This way, you can make sure the final printout’s genuinely usable. To preview a table, open it (or select it in the navigation pane), and then choose Office button → Print → Print Preview.

The print preview shows a picture of what your data will look like once it’s committed to paper. Unlike the datasheet view, the print preview paginates your data (Figure 28-15). You see exactly what fits on each page and how many pages your printout requires (and what content shows up on each page).

If you decide you’re happy with what you see, then you can fire off your printout by choosing Print Preview → Print → Print from the ribbon. This opens the familiar Windows Print dialog box, where you can pick a printer and seal the deal.

When you’re finished looking at the print preview window, choose Print Preview → Close Preview → Close Print Preview, or click one of the view buttons at the Access window’s bottom-right corner to switch to Datasheet view or Design view.

This table’s too wide to fit on one sheet of paper, so some of the columns are relocated to a second page.

Figure 28-15.  This table’s too wide to fit on one sheet of paper, so some of the columns are relocated to a second page.

Moving around the print preview

You can’t change anything in the print preview window. However, you can browse through the pages of your virtual printout and see if it meets your approval.

Here’s how you can get around in the preview window:

  • Use the scroll buttons to move from one page to another. These buttons look the same as the scroll buttons in the datasheet, but they move from page to page, not record to record.

  • To move from page to page, you can use the scroll bar at the side of the window or the Page Up and Page Down keys.

  • To jump in for a closer look, click anywhere on the preview page (you’ll notice that the mouse pointer has become a magnifying glass). This click magnifies the sheet to 100 percent zoom, so you can more clearly see the text and details. To switch back to full-page view, click the page or click the mouse pointer again.

  • To zoom more precisely, use the zoom slider that’s in the status bar’s bottom-right corner. Slide it to the left to reduce your zoom (and see more at once), or slide it to the right to increase your zoom (and focus on a smaller portion of your page).

  • To see two pages at once, choose Print Preview → Zoom → Two Pages. To see more, choose Print Preview → Zoom → More Pages, and then pick the number of pages you want to see at once from the list.

Changing the page layout

Access provides a small set of page layout options that you can tweak using the ribbon’s Print Preview → Page Layout section in the print preview window. Here are your options:

  • Size. Lets you use different paper sizes. If you’re fed up with tables that don’t fit, you might want to invest in some larger stock (like legal-sized paper).

  • Portrait and Landscape. Let you choose how the page is oriented. Access, like all Office programs, assumes you want to print out text using standard portrait orientation. In portrait orientation, pages are turned upright so that the long edge is along the side and the short edge is along the top. It makes perfect sense for résumés and memos, but it’s pure madness for a wide table, because it guarantees at least some columns will be rudely chopped off and relocated to different pages. Landscape orientation makes more sense in this case, because it turns the page on its side, fitting fewer rows per page but many more columns.

  • Margins. Lets you choose the breathing space between your table and the edges of the page. Margins is a drop-down button, and when you click it, you see a menu with several common margin choices (Normal, Narrow, and Wide). If none of those fit the bill, then click the Page Setup button, which opens a Page Setup dialog box where you can set the exact width of the margin on each side of the page.

Fine-Tuning a Printout

Based on the limited page layout options, you might assume that there’s not much you can do customize a printout. However, you actually have more control than you realize. Many of the formatting options that you’ve learned about in this chapter also have an effect on your printout. By applying the right formatting, you can create a better printout.

Here are some pro printing tips that explain how different formatting choices influence your printouts:

  • Font. Printouts use your datasheet font and font size. Scale this down, and you can fit more in less space.

  • Column order and column hiding. Reorder your columns before printing out to suit what you want to see on the page. Even better, use column hiding (Hiding Columns) to conceal fields that aren’t important.

  • Column widths and row height. Access uses the exact widths and heights that you’ve set on your datasheet. Squeeze some columns down to fit more, and expand rows if you have fields with large amounts of text and you want them to wrap over multiple lines.

  • Frozen columns. If a table’s too wide to fit on your printout, then the frozen column is printed on each part. For example, if you freeze the FirstName field, you’ll see it on every separate page, so you don’t need to line the pages up to find up who’s who.

  • Sort options. They help you breeze through data in a datasheet—and they can do the same for a printout. Apply them before printing.

  • Filter options. These are the unsung heroes of Access printing. Use them to get just the important rows. That way, your printout has exactly what you need.

The only challenge you face when using these settings is the fact that you can’t set them from the print preview window. Instead, you have to set them in the datasheet, jump to the print preview window to see the result, jump back to the datasheet to change them a little bit more, jump back to the print preview window, and so on. This process can quickly get tiring.

Tip

Don’t spend too much time tweaking the formatting options to create the perfect printout. If you have a large table that just can’t fit gracefully into a page, you probably want to use reports, which are described in Chapter 32. They provide much more formatting muscle, including the ability to split fields over several lines, separate records with borders, and allow large values to take up more space by gently bumping other information out of the way.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset