September 11, 200124 yr Newbies This seems silly that I have to post for this answer, but I'm going crazy. I have a database of company records, and I want to find companies that BEGIN with letter "A". Like "Acme Brick","American Financial",etc. NOT "Jim's Heating & Air" nor "Bob's Alley". How can you do this in find mode and/or in a script? Below is an section of my script that doesn't seem to do the trick. HELP! Enter Find Mode Set Field [ Company, "A*" ] Perform Find Go to Record/Request/Page[ First ] Loop If [ not Left(LeftWords(Company, 1),1) = "A" ] Omit Record End If Exit Loop If [ Status(CurrentRecordNumber) = Status(CurrentFoundCount) ] Go to Record/Request/Page[ Next ] End Loop
September 11, 200124 yr Use the following: ==a* This will find records which are EXACTLY (by the ==) the letter "a" followed by zero or more characters (by the *).
September 11, 200124 yr The only way you have to find records beginning with a particular letter,without scripting and without forcing user to pick symbols from search palette, involves these steps: create a calculated field (stored) in which you store the capitalized initial letter of the field in which you need perform the search (suppose LastName field). Automatically FM will calculate this for each rec. in your DB. Have this calculated field on your current layout or, better, in a search dedicated layout. Enter find mode and fill this field with the letter (capitalized) you want to search for, then perform the search. On a fly you will have displayed all records (if any) beginning with the searched letter. This trick is a good start point for building complex partial searches.Have nice job & regards. [ September 11, 2001: Message edited by: JPaul ] showtopic.php.zip
September 11, 200124 yr quote: Originally posted by JPaul: The only way you have to find records beginning with a particular letter,without scripting and without forcing user to pick symbols from search palette, involves these steps: This is correct and is a good way to do this kind of functionality. Although most often you should use scripts for your finds anyway, and I am not sure that creating and searching on calculated fields is a better solution.
February 24, 200718 yr Let's take this to the next level. What if I create a layout with only buttons, one for each letter. I want the use just to clikc the letter by which they want to search. I thought about using the script parameter and set the letter as a script parameter for each button. But have not found a way on how to use it within a script for the search. A find won't allow me to specify the function get(scriptparameter) or a storage calculated field (global). Any ideas?
February 24, 200718 yr If you have a button for each letter that passes a script parameter of the letter than: Enter Find Mode [] Set Field [ Company, "==" & Get ( ScriptParameter ) & "*" ] Perform Find []
Create an account or sign in to comment