Notices

Great community. Great ideas.

Welcome to ASP/Free, a community dedicated to helping beginners and professionals alike in improving their knowledge of Microsoft's development and administration technologies. Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: I want Null checkboxes.

Results 1 to 6 of 6
Share This Thread →
  1. #1
    meratigoerr's Avatar
    meratigoerr is offline Contributing User
    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    58

    I want Null checkboxes.

    I have a subform in datasheet view. There are two checkboxes on the form. I have the triple state property of the checkboxes set to yes. The checkboxes are bound to a field in the table. I want them to display as null if they are null. (Grayed out, or blued out in my case.) The reasoning is that I want to know if the user did not enter the information or if the boxes are checked false. It also servers a visual reminder to the user that they have not yet made the selection. I've set the default value of the checkboxes to null in the main table properties, as well as the control properties on the subform. Currently they are always showing up as false unless changed to true, but I cannot get them to display as null. The only Null checkboxes i see are in the new record of the datasheet view.

  2. #2
    June7's Avatar
    June7 is offline Moderator
    Join Date
    Apr 2009
    Location
    The Great Land
    Posts
    4,618
    Rep Power
    649
    This is one reason I avoid checkboxes and triple-state. Don't understand it. Doesn't seem to work the way it should, at least not the way I would expect. I have tried to do what you are looking for and gave up. I doubt you will have better luck.
    Last edited by June7; December 4th, 2012 at 03:49 PM.
    I like to know if my suggestion helped you. One way to let me know is by clicking star at bottom left corner of post.
    Debug!Debug!Debug!http://www.cpearson.com/excel/debug.htm

  3. #3
    meratigoerr's Avatar
    meratigoerr is offline Contributing User
    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    58
    well.... that sounds like a challenge... now I have to do it...

  4. #4
    meratigoerr's Avatar
    meratigoerr is offline Contributing User
    Join Date
    Jun 2011
    Location
    South Jersey
    Posts
    544
    Rep Power
    58
    Solution:
    After some research I've found it is possible. The problem lies in the datatype of the checkbox. The triplestate property is somewhat misleading. It will not work on Yes/No datatypes. The Yes/No datatype cannot have a null value, it always defaults to no. (unless otherwise specified by the user) The datatype of the field must be either text or number. I changed my bound field to number datatype. It required that I update all of my new number fields to null. (Conversion from Yes/No to number put a zero in all of the number fields.) The triple state property now works correctly on the datasheet subform.
    Here is the link were I found the necessary Info: Microsoft Access tips: Code accompanying article - Has the record been printed?

  5. #5
    June7's Avatar
    June7 is offline Moderator
    Join Date
    Apr 2009
    Location
    The Great Land
    Posts
    4,618
    Rep Power
    649
    Ahhh! So it is a text or number field bound to a checkbox control! Finally understand. Glad you disproved my doubt.

  6. #6
    alansidman's Avatar
    alansidman is offline Contributing User
    Join Date
    Feb 2008
    Location
    Lake County, IL
    Posts
    864
    Rep Power
    152
    And I am glad to have learned something new also. Thanks.
    Alan Sidman
    Office 2010, 2007, 2002

    If I helped you, then click "give rep" button in the lower left corner.

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. Showing Values that don't Equal field or Null as a Null
    By ipicus in forum ASP Development
    Replies: 1
    Last Post: November 19th, 2010, 12:26 AM
  2. Checkboxes
    By ldoodle in forum ASP Development
    Replies: 3
    Last Post: September 15th, 2009, 11:55 PM
  3. Invalid use of null ? how to assign Null
    By faqirullah in forum Microsoft Access Help
    Replies: 4
    Last Post: November 21st, 2006, 06:40 AM
  4. checkboxes
    By ScottishTerrier in forum Microsoft Access Help
    Replies: 2
    Last Post: January 10th, 2005, 03:14 AM
  5. Replies: 6
    Last Post: September 23rd, 2004, 01:49 AM

ASP Free Advertisers and Affiliates