October 13, 201015 yr Newbies dear all I am a novice FileMaker user and am having some difficulty with a more complex (for me, anyhow!) database I am working on. So far I have two layouts. One layout displays records from one table and the other from another table. I have a 'Find' button on layout 'A' that needs to take a value from a field and perform a search using that value and display the records it finds from layout 'B'. I thought I would be able to achieve this by setting a variable and then performing a search using this variable as the search data. I can't seem to get it to work. Here is my script that I'm trying: Set variable [$findupn; Value:Students::UPN] Go to layout ["Evidence - iPhone" (Events)] Perform Find [Restore] (Action - Find records, find records when Events::UPN=="$findupn" When I run the script the layout switches but I am told No records match this set of find requests. I have managed to get it working by using the copy and paste functions and specifying a target field but it's a very messy way of doing things. I also can make it work by setting an explicit value for the Perform Find action, setting it to something like 'Find records when Events::UPN=="12345" - the expected records and returned and displayed. Can anyone please help with what must be a very simple task I am unable to get my head around? Many thanks Stu
October 13, 201015 yr Hello Stu, welcome to the forums. Use the construct: Go to layout ("Evidence - iPhone" (Events) Enter Find Mode Set field Event::UPN to $findupn Perform Find This might also be a case where Go to Related Records is appropriate. Edited October 13, 201015 yr by Guest
October 13, 201015 yr You cannot use script variables in find requests, unless you have version 11. In previous versions do: Set Variable [$findupn; Value:Students::UPN] Go to Layout ["Evidence - iPhone" (Events)] Enter Find Mode [] Set Field [Events::UPN; "==" & $findupn] Perform Find []
November 1, 201015 yr Author Newbies Hi Thanks to both of you for your responses. Unfortunately I can't get either to work. When I try "Events::UPN; "==" & $findupn" i get the error "An operator (e.g. +, -, *, ...) is expected here." The contents of my 'Specify Calculation' box is: Events::UPN; "==" & $findupn If I change this to simply $findupn so that in the Edit Script window it reads as Set Field [Events::UPN; $findupn] it does perform the find, but it seems to actually replace the contents of Events::UPN even though Find Mode was entered in the previous step. What am I doing wrong? Many thanks for your assistance so far. Stu
November 1, 201015 yr When I try "Events::UPN; "==" & $findupn" i get the error "An operator (e.g. +, -, *, ...) is expected here." The contents of my 'Specify Calculation' box is: Events::UPN; "==" & $findupn In the 'Specify Calculation' box, enter only this: "==" & $findupn
Create an account or sign in to comment