Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Is an unchecked checkbox "0", or NULL?

Question posted by: rando1000 (Member) on July 3rd, 2008 06:27 PM
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?
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
ADezii's Avatar
ADezii
Expert
3,866 Posts
July 3rd, 2008
11:42 PM
#2

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
Reply
Not the answer you were looking for? Post your question . . .
183,814 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Microsoft Access / VBA Forum Contributors