Database Reference
In-Depth Information
UP TO SPEED: ONE OR MANY?
Strange as it sounds, pop-up menus and radio buttons both allow multiple selections , just like check-
box sets. Just hold down the Shift key while you select an item, and FileMaker dutifully turns it on
without turning off the item that's already selected. Handy though it may be, however, chances are
you don't want anyone to use this trick and choose more than one value—otherwise you'd have
used checkboxes to make it obvious that multiple choices are desirable.
Unfortunately, you don't have any direct way to turn off this feature. If you want to prevent people
from picking too many items, you have to get creative. Here's one way of doing so:
Chapter 6 introduced you to auto-enter calculations (see Data ). They let you automatically change
the value in a field, based on a calculation . You'll learn all about calculations in Part Four, so for
now you just have to have some blind faith.
Here's how to limit your fields to a single value:
1. In the Manage Database window, select the field you want to fix and then click Options. The
Field Options dialog box appears. If it isn't already selected, click the Auto-Enter tab.
2. Turn on the “Calculated value” checkbox. The Specify Calculation dialog box appears.
3. In the big free-entry box on the bottom half of the window, type LeftValues ( Self ; 1
) . This calculation tells FileMaker you want to keep only the leftmost—or first —value in
the field.
4. Click OK. You're now back in the Field Options dialog box.
5. Turn off “Do not replace existing value (if any),” and then click OK, and click OK once
more to leave the Manage Dialog window.
You're back in your database.
Now if you try to Shift-click a second item, FileMaker immediately throws it out. In practice, it
looks like it simply doesn't let you Shift-click.
To control how repeating fields display, you use the same Field section of the Inspector's
Data tab shown in Figure 7-16 . This time, focus your attention on the Show repetitions por-
tion of the palette. Just enter the first repetition you want in the “Show repetitions” box, and
the last one in the “to” box. You can't show noncontiguous repetitions here—you have to
enter one beginning and one end, and FileMaker shows those and every repetition in
between. So try this technique: Put multiple copies of the field on the layout, but specify that
each copy displays a different range of repeats. You get much the same effect as described in
the box below.
Search WWH ::




Custom Search