Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Wiring up a Checkbox for NULL

Wiring up a Checkbox for NULL

Wiring up a Checkbox for NULL


How is the best way to wire up a checkbox that is connected to a remote view that is connected to MSSQL's bit datatype? I see the checkbox control has 3 visual states, checked, blanked and a heavy outlined one that must represent null. Is this all automatic, which it doesn't appear to be...


RE: Wiring up a Checkbox for NULL

The visual style of a NULL checkbox is a light grey check, I don't remember having seen heavy outlined checkboxes. I remember also a grey checkerboard pattern, but I don't know if that was even Foxpro.

I don't know what exactly is your problem. One thing is for sure, the controlsource has to be the view field. You have to ensure the values will be .T./.F./.NULL., I think, not 0/1/.NULL.

Also, whenever the user clicks, the box will only switch to .T. or .F., it can only start with .NULL. but never get back to .NULL. If you want the user to be able to cycle through 3 states, you better use something else.


RE: Wiring up a Checkbox for NULL


I think the outlined appears when checkbox gets focus


RE: Wiring up a Checkbox for NULL

I checked it, no pun intended.

And I get a black square inside the box when it's .NULL. Focus doesn't change it's look much. That's on Windows 10, I remember there is a faint check in Win5/XP, I think Vista made the change. But I don't know when there ever was a heavy outlined checkbox. Do you have hottracking on? Either way if it's just a visual state of focussing it's not any actual state. Whatever the checkbox value is, focussing it or hovering the mouse and causing the hottracking look, does not change its value.

You can interactively set it to .NULL., if you allow CTRL+0, but that should be disabled for many reasons.

If you look for a real tristate control look elsewhere.


RE: Wiring up a Checkbox for NULL

Here is what I see in Win10p

Sorry, instead of a heavy outline, it is an inside black square.

The 2-state is fine,


RE: Wiring up a Checkbox for NULL

Yes, that's the display of .NULL.

It was more intuitive in older Windows version, where it was displayed as a faint check.

Now click it. I see it go from .NULL. to .F. (unchecked, empty) first, then .T. (checked), then .F. (unchecked) again, it's not getting back to .NULL.

Which can become a problem of a user just accidentally clicking and not getting it back to its unused state. You could of course offer a Cancel button that reverts the state to .NULL. by tablerevert(), if the record is buffered.

The only problem I see is when you fetch a bit as .null. or 0 or 1. Though the VFP checkbox also allows 0 and 1 as values. Using a view you'll just need to ensure it's taken as a logical field on the VFP side, and then it works as such. There's no dependency on the control, just on the field type.

If you use SPT and some drivers, bits can come over as integers.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close