Jump to content

Check if another field is empty. If empty select the field clicked on????


The Dog
 Share

This topic is 5680 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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 by Guest
Link to comment
Share on other sites

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 by Guest
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by Guest
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 5680 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.