How to create a checkbox field in FileMaker Pro.
For some odd reason, FileMaker Pro does not have a “native” boolean checkbox field. Instead of simply dropping a simple checkbox on to a form (called a layout…in FM Pro), you have to strictly follow a roundabout procedure to what is a dodle in virtually all other development systems.
However, in the English version of FM Pro 11, one of the sample databases; “People Management” contains checkboxes in the “issues” section for two fields:
These are labeled:
Is Legal Involved?
Is HR Involved?
And the field names in the data table are:
So, for example, to create a checkbox in the employee record to determine if the person preferred “Smoking”, (for what….hotel rooms perhaps?) You can do the following:
1. In the Value list Editor create a value list named “1”
Source = Custom Values
Values = “1”
|FileMaker Pro 11 Value Lists|
2. Go to Manage Databases. In your data table, define the field name for the checkbox field.
Give it a field type = Number
The sample shows two fields, Flag HR and Flag Legal (these field names have spaces in them, which is something I would never do.)
|Database fields for “Issues” table|
I created a new field “Smoking” in the Employee table. Set the type to “Number”
OK….so now the table fields have been defined, and lookup value has been defined. Now, what remains is displaying the field in your layout.
3. On the layout Add the new field and choose the new Smoking field within the Employee table
This starts out as a text field… looking like this:
4. In the Inspector, edit the properties of the field to change the field type to
“Checkbox Set” and change the value list to “1”. This will make the field look like this:
5. Adjust the size of the field to cover up the “1” which makes the field look normal.
6. Now when you switch to browse you get:
This appears to give a value of “1” when checked, and I’m a assuming, a ‘null’ or 0 when unchecked. Anyway, in a query for people who smoke, you’d have to look for smoking =1
I think. Not intuitive.
I’d appreciate comments and corrections from the FM experts.