1 of 1 people found this helpful
You might want to step back a bit and give us a "management view". Step way back. Why is your search string so complex? How many records are you searching? Table Dancing on a modern computer is fast enough that is it unseen by the user so, instead of doing it all in one go you might consider the simpler path - variables are very low overhead - you can do many searches in many tables very fast with simpler criteria. Tell us more...
"The real problem is not whether machines think but whether men do." --- B. F. Skinner
1. Create a Layout to have the user enter in a Coded TEXT String and press a scripted button for find the record they are seaching for.
Your use of the term variable notwithstanding, the conventional solution to your first problem would be to provide a global text field (eg defined in a utility or system table in your database schema) for users to enter their search criterion into.
2. The Coded String is long and contains the Record Index (Key/number) of another table within the string.
3. Massage the Coded String to strip out the other table's Record Index Key (I have already setup the strip method to derive the desired record index key)
After entering their search string, users will click tehe scripted button you mentioned in Goal 1. It should be a relatively simple matter to have the script that is called by that button parse out the required record key from the entered string and transfer it to a local ($var) script variable - or elsewhere - with a single command on the first line of the script.
4. Use the stripped out Record Index Key to perform a find for that record in another table and display the record in a preview form. (once I have found the record and constrained the set - I have all of the preview form portion completed)
A rather better way to accomplish this might be to use a relationship between the extracted record key and the related table, and simply place fields from the related table onto the layout so the relevant record will be displayed remotely - without any requirement to navigate to a layout based on the destination table, or to perform a find (the relationship will locate and display the matching record).
1. How do I create a field in a form layout that will contain a variable?
2. After massaging the Input variable into a 2nd Key Index variable...How do I assign the variable within a script to find the record index key in the other table?
As noted above, a global text field will provide you with a suitable field for users to enter the required search string.
If you need help forming a calculation that will parse the required key value out of the string users have entered, you might consider posting some examples of the full strings, with a description of the format and location of the keys within the string. I'm sure someone here will be happy to suggest some appropriate syntax to enable you to parse out the required index component.
R J Cologon, Ph.D.
FileMaker Certified Developer
Author, FileMaker Pro 10 Bible
NightWing Enterprises, Melbourne, Australia