This is a fairly simple method to do a Find, with multiple values (in a return separated list). [ The trouble with a normal Find of such is that FileMaker sees them as a "AND" search, not an "OR" search.] The below script does it much the same as you'd do a manual Find, i.e., adding a new Request for each new value.
It will produce an error if nothing is found, same as a manual Find. You could use Set Error Capture [ On ], and deal with it. But that is not real simple, and another post :-|
I used my own generic names for the fields, etc.. But there's only 2 fields, a global, and the regular field (near the end). It is mostly some simple Variables ( make sure each instance is named the same ):
Set Variable [ $values; Value:Textual::_gValues ]
Set Variable [ $values_cnt; Value:ValueCount ( $values ) ]
Enter Find Mode [ ]
Set Variable [ $num; Value:$num + 1 ]
Exit Loop If [ $num > $values_cnt ]
Set Field [ Textual::Data; GetValue ( $values; $num ) ]
Perform Find [ ]
// or: Constrain Found Set [ ]
[ Modified slightly, to make it even simpler.]
Thanks for your time and effort Fenton,
You are right, the problem with a normal find is that FM sees them as an "AND" search and not an "OR" search. I have found a work around. If a user checkes a value, the value is shown in the field. I have a second hidden field, that does the opposite. If a user checkes a value, the value is unchecked in the hidden field. At the end of the (extensive) search I perform finds and "omit" the records of the values in the hidden field.
But your solution is more elegant and less work, it looks logical and it is working. (And I didn't think of using a loop). I will implement your solution. (It is just a part of a very extensive selection).
Thanks again Fenton,
You might find this thread of scripted find examples helpful.
It includes an "Or" find based on the values selected in a check box.
Thanks like always Phil,
But can you include a link to the thread?