May 15, 200619 yr Hi All I'm having a problem with a script. I want to check if a field is empty and if not show a message. If it is empty all I want is to select the field I clicked on. I'm having no problem with testing for field empty but I can figure out how to select the field I clicked on. I can make it work if I make a script that selects a specified field (aka the one I clicked on) if the other is not empty. But to use this will force me to make different scripts for each field.. This works but I have to set the field I want to select.. if ["field-to-check <> """] show message ["field-to-check not empty"] exit script else go to field ["field-I-want-to-select"] end if Any help would be great.. Best regards The Dog Edited May 15, 200619 yr by Guest
May 15, 200619 yr Use the IsEmpty function in your IF script step. BTW, you don't need the Exit Script step since nothing else occurs after it.
May 15, 200619 yr Author Hi John Thanks for your fast response. But I can find the isEmpty function in filemaker 6. Maybe I should tell you that the way I am using the script is setting the field as a button and the executing the script. Is it better to make a calculation on the field?? The Dog Edited May 15, 200619 yr by Guest
May 15, 200619 yr The IsEmpty function has been around at least since FileMaker Pro 3.0. When you double-click on the If script step, look for the IsEmpty function in the list of functions. Here is what your script might look like: If [isEmpty(MyField)] Go to Field [MyField] Else Show Message ["Field is not empty."] End If
May 15, 200619 yr Author Hi John If I understand you correct I have to make a script for every field?? How else can I make a script for that uses a (MyField) format?? And I still can't find isEmpty in the scripts window in FM6. But maybe I can still use it here? The Dog Edited May 15, 200619 yr by Guest
May 16, 200619 yr MyField just represents whatever field you want to use the script for to check if it is empty. And, you will need to make a script for each field. Just change the field references to match the field you are working with. IsEmpty is not a script step. It is a calculation function you can enter when you are editing the options on your If script step.
Create an account or sign in to comment