Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Creating a simple Boolean checkbox


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

Recommended Posts

Posted

I want to add a field to my layout that is a checkbox, which I can tick or un-tick to represent a simple Boolean Yes or No.

Do I have to create a Value List of One Item?

If I create a Value List of "Compiled?", then that is value that gets put into the field, rather than a 1 or 0 or Yes or No?

Is there an easier way, or am I going to have to write a script to sort out this seemingly simple piece of interface?

Many thanks

Posted

Create a value list of one item, with "1" being that item. Make the actual field narrow to hide the value.

Another option is to define the field as a button doing:

Set Field [ YourTable::Compiled ; not YourTable::Compiled ]

and format the field as Boolean.

  • Like 1
Posted

I like the sound of the second option.

That seems to work: though I need some sort of indicator to show the two states on he button. I'll work on it.

Thanks.

Posted

I've used Conditional Formatting to make the Button dark when the value is 1 and light when the value is 0. It's not an actual tick box, but it'll do.

Posted

An easy way to switch a boolean field is:

Abs ( Sign ( Table::Field - 1 ) )

Or as Comment suggested ... not Table::Field

Posted

BTW, I forgot to mention ... as Michael suggests, you can use the field itself to make the indicators. Put another copy of your field on the layout. Turn off entry to the field. Set the font to webdings on the field. Go to Inspector, Data tab and below, specify Boolean on number. Type a 5 in the non-zero for up indicator and 6 in the zero for down indicator.

This topic is 4783 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.