Topic: Boolean

Hello,
I'm confused (not hard to do LOL)
.
Anyway I'm thinking I might use a boolean field for a Yes/No in one of my tables.  However when I try to use the field I see 3 states:
- a little blue square in the check box
- an empty checkbox
- a check mark in the box
.
What does the little blue square mean?  And why does their appear to be 3 states?
I would think that there should be only 2 states: a Check mark and a Blank (Yes/No)
.
When I first saw the little blue square I thought it meant that it was checked.  I would think this would be confusing to the average user?
.
Is there any way to just have the 2 states?
.
Thanks, Frank

Re: Boolean

In Database,
Blue(Filled) = NULL
Hollow(Unchecked) = 0
Checked = 1

You can use the that filled when you are having a filter,
marking it as filled(blue) will give you both yes and no,
yes, for all checked,
no for all no or unchecked.

brian

Re: Boolean

Brian,
You say "In Database,
Blue(Filled) = NULL
.
However I'm not sure where to apply that setting?  I looked at the boolean field in the table and don't see anywhere to put it.  I Also looked at the properties settings for the boolean field on my form and I don't see anything there either.
.
And I'm also not sure where to apply the other 2 settings you mention.
.
Thanks, Frank

4 (edited by sparrow 2021-09-23 07:52:18)

Re: Boolean

CheckBox component properties:


AllowGrayed -  Determines whether check box can be in a "grayed" state.
http://myvisualdatabase.com/help_en/CheckBox.html - please read.


Put "AllowGrayed" in the FALSE state and you will have only YES and NO.

5 (edited by papafrankc 2021-09-23 16:57:25)

Re: Boolean

Sparrow
Thanks, that appears to have solved the problem.
I had been experimenting with the Properties settings and I must have had something in the wrong state.
.
Here's what the setting are now that are working. Just an empty box and a checked box, no more little gray/blue box coming up.
- Allowed Gray = false
- Default State = false
- Checked = false
.
Reading back over Brian's solution I think I understand about the grayed box.  It looks to me like it can be Yes or No depending on how the other settings are set.  I'm not sure why I would use that, but since I don't need it, I'm not going to worry about it.
.
Thanks, Frank

6 (edited by derek 2021-09-23 20:27:10)

Re: Boolean

Hi Frank,
A quick example might help.
In the attachment there is an equipment table with items and whether they are under warranty (boolean).
On the maintenance form (Form2), the 'underwarranty' checkbox typically has 1 of 2 states - under warranty or not under warranty. 
However, on the list form (Form1), you might want to use the 'underwarranty' checkbox as a filter (as Brian mentioned in his post) and this is where 'allowgrayed' becomes relevant. 
If you do not set 'allowgrayed' to 'true', then after you run the filter, you will only be able to see 'under warranty' or 'not under warranty' - there is no way to see ALL records again short of logging out and logging back in!. 
So, 'allowgrayed' is what enables you to see ALL records again.
In the attachment, 'allowedgrayed' is set to 'false' so when you tick the checkbox filter, you see either 18 records or 9 records - never the full 27.  Change the 'allowgrayed' to 'true' and re-run it - you should be able to toggle between 'under warranty', 'not under warranty' and 'all'.
Personally, I find that the use of checkboxes can cause some user confusion and so I rarely use them, preferring to use comboboxes as less ambiguous.
Derek.

Post's attachments

Attachment icon servicerecord 4.zip 346.15 kb, 182 downloads since 2021-09-23 

Re: Boolean

Derek,
I haven't looked at your solution yet. Especially after I read the last paragraph of your post.  I only started looking into boolean check boxes because I thought they might be easier and simpler to use.
From my experience and your comment it doesn't seem like a better solution.
.
Since I already have a Yes/No combobox setup for my application I think I'll stick with it.
.
But I'll go over your solution as I always learn something new every time you post a fix.
.
Thanks
Frank