Page 1 of 2 12 LastLast
Results 1 to 15 of 19

Thread: Yes/No/NA

  1. #1
    Join Date
    Aug 2008
    Posts
    19

    Unanswered: Yes/No/NA

    Hi

    I have the Data Type of a field set to Yes/No. Is it possible to expand this to include NA.

    Thanks

  2. #2
    Join Date
    May 2005
    Posts
    119
    No, it is not possible to add a third option to a boolean type field; however, you could make the field an integer and use 1, 2, 3 to relate to Yes/No/NA...

    You could then use combo boxes to display the Text value, rather than the numeric. Was this helpful?

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    isn't there a tristate button or am I gettign confused with VB & VB.NET

    the alternative instead of 1,2,3 is.....
    -1 = no/false
    0 = yes/true
    1 = unsepcified or null
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    May 2005
    Posts
    119
    There is a button type of Yes/No/Cancel, but is displayed as cancel, not NA.
    To my knowledge, there is no way to change the prompt names, but you could use it this way:

    vbAnswer = msgbox(Message,vbYesNoCancel)

    If vbAnswer = vbYes then yourfield=YES
    else
    if vbAnswer = vbNo then yourfield=NO
    else
    yourfield=N/A
    end if

    You're still going to run into a problem if your field type is set to yes/no. It's a boolean (actually 0/-1) and can't be anything else.

  5. #5
    Join Date
    Aug 2008
    Posts
    78
    Quote Originally Posted by healdem
    isn't there a tristate button or am I gettign confused with VB & VB.NET

    the alternative instead of 1,2,3 is.....
    -1 = no/false
    0 = yes/true
    1 = unsepcified or null

    Could be just me, but I'd cringe at any logic that uses a "0" to mean true.

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    fairysnuff
    -1 = no/false
    0 = unsepcified or null
    1 = yes/true

    the precise values don't matter that much, providing the use is consistent. what ever values are used they should also be ENUMerated.
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Booleans can have 3 possible values.

    True
    False
    NULL

    Perhaps NULL can suffice as your "Not Applicable"?
    George
    Home | Blog

  8. #8
    Join Date
    May 2005
    Posts
    119
    Quote Originally Posted by PonPending
    Could be just me, but I'd cringe at any logic that uses a "0" to mean true.
    Pardon me! I program in the electrical world where everything is backwards It took some getting used to but now I can't get away from it. It's used to see normal conditions, and when the connection is broken, it goes into alarm mode (0=good/1=alarm).

    In other cases,
    Red=On or start
    Green=Off or stop....

    sorry about the confusion.

  9. #9
    Join Date
    May 2005
    Posts
    119
    Quote Originally Posted by georgev
    Booleans can have 3 possible values.

    True
    False
    NULL

    Perhaps NULL can suffice as your "Not Applicable"?
    This is a good idea, however, it won't work with buttons... You have to answer something! Will the result be put into a field?

  10. #10
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Create your own custom messagebox - basically a form, with a few buttons, that mimics a messagebox.
    George
    Home | Blog

  11. #11
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by healdem
    isn't there a tristate button or am I gettign confused with VB & VB.NET
    You can specify tristate for the checkbox control. I think this is for use with the SQL Server BIT field, which is tri-state.

    Quote Originally Posted by georgev
    Booleans can have 3 possible values.

    True
    False
    NULL

    Perhaps NULL can suffice as your "Not Applicable"?
    Not in Access. I've never been comfy with the idea of booleans allowing three values.

    I would vote for a text column with check constraints )(i.e. a natural key). Otherwise, a byte field allowing 0, 1, 2 and a related table (a la answer #1, a surrogate key).

    To input these values you have a few choices - list box, combo....
    Testimonial:
    pootle flump
    ur codings are working excelent.

  12. #12
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Posts
    201
    Using VBA, one could perhaps create three global constants, such as conYes, conNo and conNull, giving them the values 1, 0, -1. Then, you can use these to assign and compare values in a large number of situations. You could also use functions to map them onto strings such as strYes, strNo and strNull with the values "YES", "NO" and "NULL" and use them to generate RowSources and so forth.

  13. #13
    Join Date
    Aug 2008
    Posts
    19
    Thank you all for your suggestions. The fact that the YES/NO data type only accepts 2 values, i will have to re-think.

    Thanks

  14. #14
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Exclamation

    Quote Originally Posted by Celtic101
    Hi

    I have the Data Type of a field set to Yes/No. Is it possible to expand this to include NA.

    Thanks
    Hi Celtic,

    Explain just how you are trying to use this. How are you trying to get this to work? Just walk me through it.

    thanks,
    Bud

  15. #15
    Join Date
    Aug 2008
    Posts
    19
    I am using VB to save to Access database. One of the questions on the VB form is asking the user "Do you have a back up contact". I am using a dropdown with the options Yes and No. I have set the datatype for the field in the table to YES/NO but i would like to add the option NA to the dropdown on the form

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •