Jump to content

Yes/No Field Validation


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

Recommended Posts

I want to add a field validation which says that only one record in the database is allowed to have the value 'YES' in the field (or no record has the value 'YES') and all the others must be 'NO'. Can this be done using a calculation to validate the field?

Thanks in anticipation.

Link to comment
Share on other sites

No define the field as number, and format is as boolean. Then attach a script when you define the field as an invisible button as well.

This script contains just one line:

Set Field [ myYesNo; Mod(myYesNo + 1;2) ]

This script toggles the value between the two layout options you have entered in the formatting of the number.

Whether or not you should need a default value in the field is down to your requirements, but if it's so, make an autoenter value either 0 or 1...

--sd

Link to comment
Share on other sites

This topic is 6160 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
×
×
  • Create New...

Important Information

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