Database Reference
In-Depth Information
FREQUENTLY ASKED QUESTION: NUMBERS AND TEXT
You have to set an awful lot of validation options to make sure people enter only Zip codes into a
text field. Can't I just make the Zip Code field a number field instead?
No, you can't. Zip codes are numeric characters, but they're not numbers , and that makes a big dif-
ference as far as FileMaker is concerned. For example, number fields don't recognize leading zer-
os—like the ones at the beginning of 01247 and scores of other perfectly valid Zip codes. If you
enter 01247 in a number field, FileMaker thinks you meant to type the number 1,247 and will treat it
as the number 1,247 for almost all uses, including searches, sorts, and if saved to an Excel spread-
sheet. But “almost all uses” may not get your mail to North Adams, Massachusetts on time.
FileMaker is kinda, sorta forgiving on this point, but when you absolutely, positively have to rely on
the Zip code entered in a field, text type (with a numeric validation) is the way to go.
The Numeric Only validation option lets the field stay a text field (which preserves all entered char-
acters) but still accept only numerical digits on entry, which is exactly what you want for a Zip code.
Some people also assume that a phone number should be stored as a number field. Wrong again.
Phone numbers contain numerals and dashes, parentheses, and sometimes other special charac-
ters—all mere text to FileMaker. As a general rule, make a field a number field only if it's express-
ing a mathematical value like height in inches, or the price of a cup of tea.
With these settings in place, if someone enters a spurious Zip code, then he sees the error
message shown in Figure 6-7 .
Figure 6-7. When you turn off the “Allow user to override during data entry” validation option,
FileMaker won't present a Yes to accept an invalid value. So any custom message you provide
should not be phrased as a question. Instead, express the error as a statement or a suggestion.
NOTE
The Validation tab has two more options related to this one. Under “Validate data in this field” you
can choose “Always” or “Only during data entry.” If you switch to the more strict Always setting,
FileMaker enforces your validation rules even when data is modified by a script ( Chapter 12 ) . The
Always option also enforces validation when you import data in bulk ( Import Data Sources ) .
Search WWH ::




Custom Search