Results 1 to 4 of 4
  1. #1
    Nerther is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2013
    Posts
    4

    Yes/No Field without having a preselected value

    Hi,



    this is a very simple question, but has me quite simply a tad lost.

    I have a form bound to a table. In the table I want to create a yes/no field.
    I choose to create an option group to display the result of the field.

    I.e. Is this person a smoker, Yes/No.

    But, when a new record is created, the No option is already pre selected. I don't want the pre selection because I want to prompt the user to choose. As it turns out, in the field of the table, the 0 value is already assigned by default.

    I've tried assigning NULL to the table default value property plus everything else I can think of but it always comes out to 0.

    I don't mind if it's not an option group. A simple drop box that shows Yes/No would suffice, as long as it doesn't have a value preselected after record creation.

    Does anyone have any ideas?

    Thanks in advance.

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Check the Default Value property setting of the control on the form. Remove the 0, if it is there.
    Last edited by Bob Fitz; 04-06-2014 at 06:31 AM.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    AFAIK, doesn't matter if the DefaultValue of Yes/No field (or associated control) is set to nothing, if the field is not True then it is False. Demonstrate in table by creating a new Yes/No field, remove 0 from DefaultValue, set Lookup DisplayControl property to Textbox. Save table and switch to Datasheet. Every record shows False. That's the nature of Y/N field, it has only two states - on or off - and must be one or the other. Checkbox control does have a TripleState property but I have no idea what it's for. I have experimented with it but never figured out a use for it.

    EDIT: I remember what I discovered about TripleState property. It is useful only with UNBOUND checkbox.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    As usual, June is quite right. So I would suggest a text field in the table with it's Required property set to Yes. Then create a combo box control on the form, which only allows selection of Yes or No and bind the combo box to the new text field in the table.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 17
    Last Post: 03-16-2014, 10:52 PM
  2. Replies: 3
    Last Post: 12-27-2013, 02:33 PM
  3. Replies: 1
    Last Post: 03-03-2012, 10:17 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums