Connecting Tech Pros Worldwide Forums | Help | Site Map

Is an unchecked checkbox "0", or NULL?

Member
 
Join Date: Aug 2007
Posts: 74
#1: Jul 3 '08
So I have this form that captures Me.CheckboxName.Value as part of an SQL statement. For one checkbox, it evaluates as 0, which is great, because I'm filling a Yes/No field with it. But for another checkbox, it evaluates as NULL, which is not so good. I know I can program around this with an If statement (or a number of other ways), but shouldn't Me.CheckboxName.Value be consistent across like controls?

ADezii's Avatar
Expert
 
Join Date: Apr 2006
Location: Philadelphia
Posts: 5,218
#2: Jul 4 '08

re: Is an unchecked checkbox "0", or NULL?


To the best of my knowledge, a Check Box can only evaluate to True (-1) or False (0), 'unless' its TripleSate Property is set to Yes. When you set a Check Box's TripleState Property to Yes it can display Null values. The Check Box will then cycle through states of Yes, No, and Null. The Check Box will appear dimmed (grayed) when its Value property is set to Null. Hope this helps.
Reply