View Full Version : Solved: Checkboxes... huh?
belly0fdesir
06-27-2007, 04:33 PM
I have several checkboxes and in the VBA code attached to one of my buttons, I refer to these checkboxes. When I insert a breakpoint, the checkboxes are always showing as null... I need them to show as "True/False" or "1/0" or ANYTHING other than null... Can someone help me with this?
Thank you in advance,
-b0d
In the Form's "On Current" event set the check boxes to 0 when they are not already set -
if isnull(me.checkbox1) then me.checkbox1 = 0
mattj
06-28-2007, 08:13 AM
Just FYI, even when the "Triple State" property for a checkbox is set to No, if the checkbox has not been checked or unchecked, its value is always Null
Matt, ?? :wot
If you set the checkbox to 0 whether it has previously been checked or not it still returns 0.
mattj
06-28-2007, 09:25 AM
OBP - you are correct. I was just attempting to say that checkbox that has not been explicitly set to 0, and that has never been checked will always return a value of Null. For example, place a check box on a form - go to the Immediate window and type debug.print forms!formname!checkbox name, the result will be null...
Sorry for the confusion
Matt, yep I agree, hence my suggestion. :thumb
geekgirlau
06-29-2007, 12:02 AM
I wouldn't even bother to set them on loading the form - you can either set the default value of the checkbox as 0, or when checking use nz(me.checkbox1,0).
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.