I have a value list that has check boxes accompanied with each value. I want to write a script that will give me the particular value that has been checked.
so if you had three values, say: Apple; Orange; Kiwi
You want to find all records that have "Kiwi" checked?
Enter Find mode [pause:off]
Set field [ Yourtable::CheckBoxField ; "Kiwi" ]Set Error Capture [on]Perform Find [ ]
It get's more complicated if you want to find records with specific combinations of selected check boxes.
I read your question a couple of times and I think what you are asking is to see the actual checked value in a field. Checkboxes store the checked items as a return-separated list. For example, if you had a checkbox with A, B and C as choices, checking all three would look like the following if you placed the same field on the layout without the value list attached:
If you check just "A" then it will look like this:
So, if you want to see the value on a layout, just place the field on the layout without a value list attached.
Hello Kawaii !!
I hope you find this example helpful
A field with the control set to "checkboxes" uses a defined value list (preset static values or from a field).
In reality, as others have said, every check is that value added to the field (without the control). Multiple values get added in the order they are checked and have a return character (ASCII 13) between the values.
So a question back to you: Do you have other find criteria and/or do you need to use ONLY the checkbox values to find?
If you are looking to "match" every record where one (or more) of the checkboxes might be found, you can use a clever "feature" of FileMaker Pro. It's called "multi-line key" relationship. Every value in a return separated list matches any record with that value (single value field or also multiple value).
So if you have a global field that also has the same control (checkboxes) applied in Layout Mode, it can be a "key" to match any of the checked values. Use this global storage field as one of the relationship keys (self join or located in another table) to the the field with checkbox control upon which you search.
This is called an "OR" search and is similar to the SQL usage of WHERE x IN ( ... )
Once there is a "match" this way you can use GTRR ( Go to Related Record ) to 'find' the matching records.
It is possible to use this and then place additional criteria on that found set with a Constraining (narrowing) a found set .
If you need to match exactly what is checked, remember that the order is maintained. So you cannot match (equally):
Apple¶Banana with Banana¶Apple without other tricks (FilterValues , for example).
Perhaps you can further define your needs and I'm sure we'll help you get there!
to make it more clear...
I have one layout 1 that has
A B C - checkboxes w/ value list
it is connected to layout 2 that also has
A B C - checkbox w/ same value list as
... in layout 2, I have checked B.
What I want the result to be: In Layout 1, I run a script that checks to see which box got checked, could be A, B, or C (in this scenario, Box B) and I want to check box B.
Layouts are not "connected". Tables are connected via relationships set up to link table occurrences. A layout, table and table occurrence may have the same name, but they are not the same thing.
So what do you mean when you say: "layout 1 is connected to layout 2"?
Are these layouts based on different table occurrences (boxes on your relationship graph) and are these linked in a relationship? If so, please describe that relationship. If you mean that they are "linked" in some other way, please describe what you mean in more detail.
Note that match fields where the fields are formatted with a value list of multiple check boxes have some unique qualities that may or may not work for you here.
Retrieving data ...