The script shown is correct, but the error message is telling you that $$current_subscriber does not store any value.
Check to be sure that this variable is actually getting a value and make sure that you haven't typed the name of the variable differently in the spot where you capture the current subscriber and the set field step shown above.
Thanks. Is there any way in which I can check whether the variable is indeed getting a value? I have made sure that the variable names are consistent by using cut and paste.
The current wording for the first script is as follows:
Set Variable [$$current_subscriber; Value:Subscribers::Customer Number]
Go to Related Record [From table: "Subscribers 2"; Using layout: "Subscribers" (Subscribers)]
If you have FileMaker advanced, you can run the script in the script debugger and use the data viewer to monitor the value of your global variable.
If you do not, you can temporarily add a show custom dialog box and use:
Quote ( $$Current_subscriber )
in the dialog to show the value of the variable enclosed in quotes. (By using Quote, a variable that does not have a value will result in empty quotes appearing in the dialog.) You might put that step in twice, once just before Go to Related records and once just before Enter FInd mode to a) see if the variable got the correct value and b) see if the variable still has the correct value at the time your script performs the find.
Thank you. That was helpful and I've managed to find the source of the problem. The scripts were fine; the problem actually was in the button setup!