In my last post, we talked about leaving a field in its default control style: the Edit box. Why do we ever need anything more than that?
Well, if you’re always going to be entering one of a selection of values in that field, then it’s a shame to have to type them every time. When you make your users do something like that, you are really inviting them to make a lot of typos. That can throw off your finds and your reports.
So let’s help our users out, shall we?
I’ve created a quick and dirty database to keep track of projects for a FileMaker Development company. Here’s a screenshot:
Waiting for client input
So in a database that tracks hundreds of projects, are you going to make your users type one of those values each time the status of a project changes? Dude, that’s just cruel.
Have you created a value list before? It’s not so bad.
Go up to your File menu, select Manage, and then select Value Lists. This invokes the “Manage Value Lists” dialog.
Click the New button to get to the Edit Value list dialog. Enter a Value List Name of “ProjectStatus_c”, and then enter all your possible statuses (That plural always sounds wrong to me — stati? Okay, that’s worse!) in the “Use custom values” area. Make sure the values are separated by carriage returns. It should look like this:
Now as it says in the bible, “Go thee forth into Layout Mode” — or something like that (a lot of years have gone by since I was made to go to Sunday School!).
Click on the projectStatus field, and then do the following in your Inspector:
- This time you want your Control style to be “Drop-down list”.
- In the Values from area, select the value list you just created — ProjectStatus_c.
- Check the box for “Include arrow to show and hide list”.
- Check the box for ”Auto-complete using value list”.
Okay, but what does all that do? Let’s go back into Browse Mode and have a look.
That’s cool. Also, since you clicked the checkbox for “Auto-complete using value list”, if you were to type in the field instead of clicking the triangle, it tries to complete for it for you — using the value list items. See what happens when I type an “o”.
That’s also cool.
So along with the fact that you can pick items from a value list, are there other advantages to using a drop-down list, O Wise One? Yes, there are, but you’re making me blush!
- Since you can type in it (with auto-complete) and click on the triangle, you can keep both the keyboard-users and the mouse-users happy.
- Since you can type in it, you can ignore the value list, and type a whole different value. That may be an advantage if you want to allow your users to have a little bit of freedom; they can reduce their typing if they want to pick from one of the value list items, or they can type something else if not.
… and that brings me to one tiny technique that one of my clients so aptly named a “learned list”. Suppose we don’t know what the values are that we want in the value list; we don’t want to restrict the values, but do want to make data entry easier for our users.
Let’s go back into where we created our value list:
Now let’s go back to Browse Mode. If you haven’t entered any data in the projectStatus field yet, then clicking the triangle with get you a big fat nothing. Since it’s selecting values from the index of this field, and there are no values entered yet, there is nothing to show.
Let’s type something in there now. For example, “Who the hell knows?” (I certainly don’t have any projects with that status, but I can’t speak for others!)
Now click on the triangle and what do you get?
Each time you type a new value in there, it will become one of the value list items. That’s kind of cool: a self-populating drop-down list.
So in summary, when do you use a drop-down list instead of an edit box? You want to give your users the opportunity for more efficiency and accuracy by selecting from the value list, but you want them to have the flexibility to type what they please.
- So what’s with the suffixes on the value list names? “_c” means it is a custom value list; “_d” means it uses a value from a field (someone I used to work with used the d, and I just got used to it — probably would have used an f myself); “_r” uses related values from a field.
- My learned list technique is pretty cool, but shouldn’t be used if you have a large number of records to pull from — especially if it is from a related table. Data entry can get very slow, because the value list has to look at a much larger index of values. So use this technique with care.
- The above warning also applies to “Auto-complete using value list”.
- If you know that most new records will have a certain field value, save your user the effort: have it auto-enter. For example, if your client table has a field called “status” that is always Active or Inactive, then you can have it auto-enter a value of “Active”. Whenever you’re creating a new client record, it is probably because they are becoming an “active” client. Why would you want to force your users to enter that data when they don’t have to?