October 17, 200619 yr I have a drop down list where it is necessary to search for any of the items in the list that are selected (by holding down the command (apple) key). This creates a repeating field entry in the find global. The field it is searching is not a repeating field and therefore would never match the repeat of the find global. Is there a way to take each entry in the repeating field and have the search return any records that match any of the words in the repeating find field? Thanks, Drew
October 17, 200619 yr Too weird... we both asked basically the same question at the same time... Honest folks... we don't work together.
October 17, 200619 yr Haven't tried it, but how about a scripted find? Select each of the repeating values one at a time with the '[X]' bracket option after the field name and extend the set for each one. Yes/No?
October 17, 200619 yr Author Sounds like an idea... The find is already scripted so some particulars are needed so I can implement them in to the script.
October 17, 200619 yr Matt Petrowsky has several tutorials on this at: http://www.filemakermagazine.com/index.php Do a search for "OR search" and chose technique and you'll see the list. HTH
October 17, 200619 yr You don't need a repeating field for this. Just make a script along the lines of: # CREATE THE FIRST REQUEST (N = 1) Enter Find Mode [ ] # # START LOOP Loop # # SET THE SEARCHED FIELD TO THE Nth VALUE OF VALUES TO SEARCH FOR Set Field [ Table::Value; MiddleValues ( Table::gValues ; Get ( RequestCount ) ; 1 ) ] # # IF THERE ARE NO MORE VALUES (N ≥ VALUECOUNT), WE ARE DONE Exit Loop If [ Get ( RequestCount ) ≥ ValueCount ( Table::gValues ) ] # # ELSE, CREATE A NEW REQUEST AND REPEAT THE LOOP WITH N = N + 1 New Record/Request End Loop # # Perform Find [ ] In this example, 'gValues' is the field that holds multiple values to search for (your drop down list) and 'Value' is the searched field. Edited October 19, 200619 yr by Guest
October 19, 200619 yr Author Although I can understand most of the script there is some of it that is a little fuzzy for me. I was not able to make the script work, I kept getting an error when I did some of the calculation entry. What would be really helpful is if you could dissect the script and caluculations for me. I know that is asking a lot but it is like teaching me to fish instead of just giving me the fish. In the future I will be able to better help myself. Thanks so much! Drew
October 19, 200619 yr On each loop, the script creates a new find request. The request number is used to pick the corresponding value from the stack of values to search for. When the number of requests equals the number of values to search for, we are done. I have edited my previous post and added some comments (and a minor simplification). If you still experience problems, post the exact error message and what did you do before you got it.
October 21, 200619 yr Author When I enter the set field exactly as shown I get "a number, tesxt constant, field name or "(" is expected and it High Lights the first bracket.
October 21, 200619 yr Can you be more descriptive? The MiddleValues() function in the Set Field[] above looks right to me.
October 21, 200619 yr Author I just had to enter it a bit different and got it to work great! Thanks for all the help! This is what I did instead. Enter Find Mode [] Loop Insert Calculated Result [select; Table::Value; MiddleValues ( Table::gValues ; Get (RequestCount) ; 1 )] Exit Loop IF [( Get ( RequestCount ) ) ≥ ( ValueCount ( Table::gValues ) )] New Record/Request End Loop Edited October 21, 200619 yr by Guest
October 21, 200619 yr Author After implemting it and reading the help files related to all the used functions I understand what is going on. Thanks so much for this. Without your help I dont think I would reached this good of solution! Edited October 21, 200619 yr by Guest
Create an account or sign in to comment