Editing Whats in Your Fields

Editing What s in Your Fields

Once you've found the records you want to work on, it's time to learn timesaving and creative ways to revise and format your record text. FileMaker fields are a lot more capable than the little fields you're used to from dialog boxes. Each field is like a miniword processor, with features that you're familiar with if you've ever written a letter on a computer. Of course you can do basic things like select text, and cut, copy, and paste. There's even a Find and Replace feature and flexible text formatting powers. Read on to find out what you can do.

2.5.1. Find and Replace

Like your word processor, FileMaker has a Find and Replace feature. And also as in your word processor, you can (and should) use Find and Replace tools as often as possible to automate your editing process and eliminate retyping.

Suppose one of your clients is called Anderson Consulting. For one reason or another, they decide to change their name to Accenture. Unfortunately, you have 27 folks in your database with the old name. You could look through your records one by one and fix them yourself, but you're never going to become a database guru that way. Instead, do a Find/Replace operation.

FileMaker fields can hold a lot of information, and it's not at all uncommon to put things like letters, emails, product descriptions, and other potentially long documents into a field. In cases like this, the Find/Replace command is just as useful as it is in your word processing program.

Since FileMaker has fields and records to worry about, though, its Find/Replace dialog box is a little more complicated that what you may be familiar with. Luckily, the concepts are simple, as shown in Figure 2-10. The Find/Replace dialog box lets you search a field, a record, or all records for a little snippet of text. It can also replace every occurrence of that text with something neweither one at a time, or all at once.


Note: Don't confuse Find/Replace with Find mode. Find/Replace is for finding text in one or more fields and one or more records. Find mode is for finding records. You'll probably use Find mode much more often than Find/Replace. For the full story, see the box on Section 2.5.1.


Here's FileMaker's version of Find and Replace:

  1. Choose Edit Find/Replace images/U2192.jpg border=0> Find/Replace.

    In the lower-left corner of the dialog box, turn on "Match case" and/or "Match whole words only" to tell FileMaker how you want it to match the text you're looking for.

    Turning on "Match case" ensures that FileMaker looks for an exact uppercase and lowercase match. For example, when "Match case" is turned on, "Kite" and "kite" don't come up as a match.

    If you turn on "Match whole words only," FileMaker eliminates partial word matches. For example, "Drag" matches "Drag" and not "Dragon."

    Figure 2-10. In FileMaker, you use the same dialog box both to find text and to find and replace text. If you aren't replacing anything, don't click any of the Replace buttons. The text you're looking for goes in the "Find what" text box. If you're replacing it with something new, type that text in the "Replace with" text box. (If you want to replace some text with nothing, making it go away, leave the "Replace with" box empty.)

     
  2. Under "Search across," select either "All records" or "Current record."

    You've just told FileMaker whether you want it to look through all the records in the found set, or only the record you're currently on. In a case like the Anderson/Accenture example, choose "All records."

  3. Under "Search within," select either "All fields" or "Current field."

    "Current field" refers to the field you were editing when you opened the Find/ Replace dialog box. If you weren't editing one, FileMaker will let you pick Current field, but when you try to find, it will complain with an error message. You're allowed to select any combination of Search across and Search within. Here's how that shakes out:

  4. All records and All fields. FileMaker looks through every field in the window for a match. When it's done, it moves on to the next record.
  5. Current record and All fields. FileMaker looks through every field in the window, then tells you it's finished.
  6. Current record and Current field. FileMaker looks only in the current field. When it reaches the end of the text in that field, it stops.
  7. All records and Current field. FileMaker looks through the current field, then moves to the next record. It keeps looking through records for more matches, but it pays attention only to the current field.

Figure 2-11. The Find/Replace command expects you to give it a Direction. To decipher what that means, you have to do a little visualization. Here's a picture of the imaginary string, starting at the beginning of the first record, and stopping at the end of the last. When you click into a field, and the insertion point sits there blinking in front of a letter, it's marking a spot on the imaginary string. If you're not clicked into a field, FileMaker decides to mark the string right before the first letter of the first field of the current record. In this example, your cursor is sitting right there between "Made" and "Dragon."

Now that you're through setting all your Find/Replace options, it's time to decide which button to click:

  1. Click either Find Next, Replace & Find, or Replace All.

    Find Next starts FileMaker looking. When it finds a match, it highlights it right in the field. The Find/Replace window doesn't go away yet, though. This way, you can click Find Next as many times as necessary to find what you're looking for, then click Replace to change it to your replacement text. Click Find Next again to go to the next match.

    UP TO SPEED

    Find/Replace vs. Find/Replace

    You may be wondering how Find mode combined with Replace Field Contents is different from Find/Replace (discussed earlier in this chapter). In fact, they're very different, but deciding which to use can be confusing. Here are some guidelines:

    • Find mode is significantly faster at finding things than Find/Replace. In Find mode, FileMaker uses something called an index, which lets it find ten matching records out of 293,000 in an instant. Find/Replace, on the other hand, looks through the fields the same way you would: one by one. It's faster than you, but it still takes time.
    • Replace Field Contents always operates on one field across the entire found set. Find/Replace, on the other hand, also lets you replace across all fields in just the current record, as well as all fields and all records in the found set.
    • Replace Field Contents always replaces the entire contents of the field. You can't replace every occurrence of "the" with "the" for example. You can only give a new value that replaces whatever is in the field.
    • Most important, Replace Field Contents assumes you've already found the records you want, and always modifies every record in the found set. Find/Replace adds a second layer of searching, as it scours the record or the found set looking for matches.

    So why would you ever use Replace Field Contents? Sometimes you really do want to replace everything in the field every time, just like in the Company Name example on Section 2.3. Also, Replace Field Contents is significantly faster at changing lots of records than Find/Replace. It takes just a few seconds to accomplish what Find/Replace would spend several minutes doing.

    In general, if you want to find records, use Find mode, but if you want to find certain bits of text, use Find/Replace. Likewise, if you want to replace everything in a field in every record, use Replace Field Contents, but if you want to replace little bits of text, use Find/Replace. (If you want to replace little bits of text across thousands of records, study Chapter 7 first, or be prepared to take a vacation while your computer thinks about it.)

    Finally, there's no reason you can't mix Find/Replace with Find mode. Since Find/Replace only searches records in the found set, you can establish a good found set first to make your Find/Replace go faster. (For example, if you're replacing "the" with "the" in the Notes field, you may as well find all the records that have "the" in their Notes field first, since Find mode is so much faster than Find/Replace.)

     

    If you feel the need to work more quicklysay you've done Find Next and Replace a couple times and everything looks in orderclick Replace & Find instead. It replaces the current match, and then finds the next one all in one step. Repeat as many times as necessary.

    Finally, if you're sure you want every match replaced, click Replace All, and FileMaker will do the entire find-replace-find-replace dance for you. FileMaker always asks you if you're sure about Replace All first, just in case. For instance, if you have some clients whose last name is Anderson and others whose company name is Anderson, you may not want to use the Replace All option. You'll need to check each occurrence individually to make sure you don't accidentally change someone's last name to Accenture.

    WORKAROUND WORKSHOP

    Get Out of My Way

    Unlike the Find/Replace window in most other programs, FileMaker's won't politely step aside. If you try to click in your database window to switch back to it, FileMaker just beeps at you. In fact, you can't do anything else but find and replace unless you close the Find/Replace window first. You can always move the Find/Replace window around the screen by dragging it, but if your database window is big, or your screen is small, the Find/Replace window can really get in the way, keeping the very results it's finding hidden behind it. Here are a few pointers to help you cope:

    Make sure the Find/Replace window is as small as possible by dragging the resize handle in the lower-right corner. Like most windows, it is resizable, but its smallest size is almost always big enough.

    If you close the Find/Replace window (Click Close or just press Escape), FileMaker keeps the last-found item highlighted. Since FileMaker remembers all your settings, you can always open the Find/Replace window again and continue searching where you left off.

    Wouldn't it be great if you could click the buttons in the Find/Replace window without having it open onscreen? Fact is, you can. In the Edit Find/Replace menu, youll see two handy commands: Find Again and Replace & Find Again.

    Choosing these menu commands is just like clicking the Find Next and Replace & Find buttons in the Find/Replace dialog box.

    FileMaker also offers one more convenient shortcut. If you have some text already in a field, and you want to find the next occurrence of the same text, you can choose Edit Find/Replace images/U2192.jpg border=0> Find Selected. This one command does the same thing as copying the text, opening the Find/Replace window, pasting into the "Find what box, clicking Find Next, and then clicking Close. All the other options in the Find/Replace window stay just as when you last used them.

    Best of all, these handy commands all have keyboard shortcuts:

    • To find the next occurrence (Find Again), just press Ctrl+G (-G).
    • To replace the currently selected text and find the next occurrence (Replace & Find Again), press Ctrl+Shift+G (Option--G).

    To find other occurrences of the selected text, press Ctrl+Shift+H (Option--H)

     
  2. >When you're done with the Find/Replace window, just click Close.


Warning: Find/Replace can take a long time because it looks through the individual words in each field. If you're searching across all records, and you have lots of records, be prepared to wait a while as FileMaker does its magic.


2.5.2. Fields for Lots of Text

Click in the Notes field in the Contact Management database. Notice that when you do, a scroll bar appears on the right side of the field. If you type lots of notes, you'll be able to scroll through them. FileMaker fields can hold a lot of text. Technically, each field is limited to two gigabytes of data per record, which is a fancy way of saying "way more than you'll ever need." (When you design a database, you get to decide which fields have scroll bars, as discussed on Section 4.4.7.2.)

You can enter text into a field in all the usual ways, like typing on your keyboard or pasting text you copied from another field or another program. You can also select text in one field and drag it into another. (In Mac OS X, in fact, you can drag text into a field from any other program.)


Note: Even if a field doesn't have scroll bars, you can still add lots of text. In this case, FileMaker just makes the field grow to hold whatever you type. When you leave the field, it shrinks back to its normal size, hiding anything that goes outside the edges. Don't worry, though, the text reappears when you click back into the field.


2.5.3. Drag and Drop Editing

In addition to copying and pasting, you can drag text from one place to another. But first, you have to turn it on in FileMaker's preferences, like so:

  1. On Windows, choose Edit Preferences. On Mac OS X, choose FileMaker Pro images/U2192.jpg border=0> Preferences.

    Confirm that "Allow drag and drop text selection" is checked.

    If you decide you don't like using drag and drop, just come back here and turn it off.

  2. Click OK.

Now that dragging is turned on, here's how it works:

  1. Make a new record (Records New Record).

    Type Editing text a is drag into the Notes field.

    Yes, it says "text a is." Type the mistake and all. Next you'll drag to fix it.

  2. Double-click the word "is."

    The word is highlighted to let you know it's selected.

  3. Drag the selected word over between "text" and "a."

    Figuring out where dragged text is going to land can be tricky. If you look closely, you'll see that in addition to the text you're dragging, a little vertical line moves along under your arrow. You can see this in action in Figure 2-12.

    Figure 2-12. When you turn on "Allow drag and drop text selection" in Preferences, FileMaker lets you drag selected text around with the mouse. Here, the word "is" is being moved after "text" by dragging. The little vertical line under the arrow shows you exactly where the text will go when you drop it.

     

    You'll probably have to fix the spaces between words. Unlike most word processors, FileMaker isn't smart enough to figure out where they go for you.


Note: You can also drag text from one field to another. Instead of moving the text, FileMaker copies it. In other words, once you let go of the mouse button, the text will be both where it started and where you dropped it. If you want this behavior when dragging within a field, hold down the Alt (Option) key while you drag.


2.5.4. Text Formatting

Just like a word processor, FileMaker has commands to set the Font, Size, and Style of the text in a field. (Figure 2-13 shows a field with formatted text.) This feature comes in handy for many reasons. For instance, imagine you have some really important information about a customer ("NEVER PAYS HIS BILL") that you want to keep in the Notes field. To make sure it gets noticed, you can make it big, bold, and red. You can even use one of those fancy frilly fonts just to keep things interesting.

The formatting commands for font, font size, and type style are in the Format menu. But before you change anything, you'll notice that all FileMaker fields come with a preset (and pretty boring) standard formatting. (Part 2 of this book explains how you can change this automatic formatting.) Each of the formatting commands covered in this section lets you override the standard formatting for a field on a record-by-record basis.


Warning: Consider (and remember) the full implications of the paragraph above: All of the techniques described in the rest of this chapter pertain only to editing and formatting individual records. If you would like to change a field's formatting across the board, you need to make that change to your databases layout. For example, you might want all last names in your database to appear in boldface letters, or put a box around everyone's phone number. You'll learn how in Part 2 of this book.


Figure 2-13. You can format the text in any field just like text in a word processor. FileMaker lets you assign fonts, sizes, styles, colors, and more. You can even adjust paragraph attributes like line spacing, indenting, and alignment. In this record (from the Contact Management database) every field but Email Address has had its contents stylized.

 

2.5.4.1. Font

FileMaker lets you pick from all the fonts you have on your computer (see More Fonts on Windows if you don't believe it). Using a font is a breeze if you're one of those FileMaker users who's heard of a computer. Just select the text you want to change, then choose the font you want from the Format Font menu. (If youre the type who plans ahead, you can also choose a font before you start typing.)


Tip: As with all FileMaker's editing commands, if you make a mistake, just choose Edit Undo. Or use your trusty Undo keystroke: Ctrl+Z (Windows) or -Z (Mac).


2.5.4.2. Size

Changing the size of text is equally easy. Like changing fonts, you simply select the text and pick a size, in points, from the Format Size menu. (Again, you can pick the size Size menu only lists a few standard sizes. If you need a size thats not listed, just choose Format images/U2192.jpg border=0> Size images/U2192.jpg border=0> Custom and FileMaker will let you enter any point size from one to 500. (See Section 4.4.6.3 for more detail on font sizing.)

Immediately after Custom, one last size is listed. This one isn't separated from the rest just to be cuteit shows the last custom size you used. If you prefer 11 point, you only need to visit the Custom command once.

Once you've made the change, 11 will be listed at the bottom of the menu…until you decide that 13-point type is your new favorite, that is.

UP TO SPEED

More Fonts on Windows

On Windows, the Font menu may not show the fonts you wantit normally only shows a few (on Mac OS X, the Font menu always displays all your fonts). To get to the rest, choose Format Font images/U2192.jpg border=0> Configure/More Fonts to show the Configure Font Menu dialog box. Once here, you can do three things: Pick fonts that dont show in the menu, control which fonts do show in the menu, and change how they display.

  • The Available Fonts list shows every font installed on your computer. If you want to choose a font that isn't in the Font menu, select it from the Available Fonts list and click Apply. Unlike every other Apply button you've ever seen, this one applies the new font selection and dismisses the window.
  • To add a font to the Font menu, select it from the Available Fonts list and click Move to add it to the Appear in Menu list. If you want the menu to show every possible font, click Move All instead. When you select a font from the Appear in Menu list, the Move button changes to Clear, and a click removes the font from the list. As usual, you can double-click font names to mimic the Move or Clear buttons.
  • FileMaker can show fonts in the menu in their own typeface. For instance, the words "Times New Roman" will actually be in Times New Roman in the menu. If you don't want this behavior, turn off Show Fonts in Typeface. This setting also affects the display of fonts in the Appear in Menu list right in this dialog box.

When you're finished configuring, click OK. Your selected text won't be changed, but the font menu will now list the fonts you put in the Appear in Menu list. If you want to change the font of the selected text at the same time, select the font and click Apply instead.

 

2.5.4.3. Style

Using styles is a snap. Pick the style from the Format Style menu and start typing, or select some text and apply a style. In addition to the industry-standard Bold, Italic, and Underline styles, FileMaker adds a few less common options to the mix. Except where noted here, you can mix-and-match styles to your hearts content (see the Notes field in Figure 2-12).


Note: The keyboard shortcuts for text styles in FileMaker are non-standard. While in most programs Ctrl+B (-B) means Bold, in FileMaker it's Ctrl+Shift+B (-Shift-B). The same goes for Italic and Underline. This change takes a little getting used to. Basically, take the keyboard shortcut you use in all your other programs, and add the Shift key.


2.5.4.4. Text Color

The miniword processor wouldn't be complete without colors. The Format Text Color menu gives you a handful of colors to choose from. If you dont like those options, you can select Other Color (located below all the little color squares in the menu) to pick any color you want, as described in Figure 2-14.

If you don't like the assortment of colors FileMaker provides, you can change them in the Edit Preferences (Windows) or FileMaker Pro images/U2192.jpg border=0> Preferences images/U2192.jpg border=0> Layout panel (Mac). You get three choices: System subset, Standard system palette, and Web palette (see Figure 2-14). The normal palette (System subset) gives you 88 colors, which most FileMaker mavens find more than sufficient. Its also nice because it's small enough for you to remember what color you've been using ("the third red from the top").

If you find the System subset palette too limiting though, feel free to try one of the others. The Standard system option displays the color palette built into your computer's operating systemWindows or Mac. Since you've probably seen this color arrangement elsewhere on your computer, you may find it easiest to use.

Figure 2-14. The Format Text Color menu offers a handful of canned color choices. If youre not happy with the colors you see, you can pick from two other palettes in FileMaker's Preferences dialog box. Whichever palette you choose determines the selection of colors you get when you choose from the Text Color submenu. Choosing "Standard system palette" gives you the most colors to work with.

The Web palette lets you choose from the set of 216 colors commonly considered Web safe; that is, they're guaranteed to look pretty much the same in any browser on any computer. At one time, you needed to stick to only these colors if planning to publish your database on a Web site (Chapter 18), but the truth is you don't really need to worry about Web safe colors anymore. Every computer sold since, oh, about 1997 can display more colors than you ever dreamed of.


Note: The Format Text Color menu is just one of several places where a color palette shows up in FileMaker. Youll see the others in Part 2. Just remember that if you change the color palette selection in preferences, the change affects the color palettes throughout FileMaker.


2.5.4.5. The Text Format Dialog Box

FileMaker provides one-stop shopping for all your text-formatting needs. Suppose you want to change a word to red 13-point bold-italic-underline-uppercase-condensed. That looks to be about seven trips to the Format menu. Instead, choose Format images/U2192.jpg border=0> Text to summon the Text Format dialog box (Figure 2-15). This one little window combines the Font, Size, Style, and Color menus described in the previous pages into one convenient place, turning seven menu commands into one. (Now if only it had a keyboard shortcut.)


Note: The Paragraph button reveals the Paragraph dialog box. It's covered on Section 2.6.4.


Figure 2-15. The Text Format dialog box (Format images/U2192.jpg border=0> Text) helps cut down your mouse mileage. It combines Font, Size, and Color (exact copies of their counterparts in the Format menu) with individual checkboxes for each style. As you make selections, the text in the Sample box reflects your changes.

Категории