Results 1 to 8 of 8

Thread: checkbox question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    166

    checkbox question

    How do I test to see if a checkbox has been checked at run time?

  2. #2
    Lively Member bren0098's Avatar
    Join Date
    Jul 2005
    Posts
    67

    Re: checkbox question

    if checkbox_name.value = 0 then '...checkbox is not checked
    if checkbox_name.value = 1 then '...checkbox is checked

  3. #3
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: checkbox question

    You can also do:
    if checkbox_name.value = VBChecked
    if checkbox_name.value = VBUnchecked
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  4. #4
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: checkbox question

    Quote Originally Posted by isnoend07
    You can also do:
    if checkbox_name.value = VBChecked
    if checkbox_name.value = VBUnchecked
    While that's the preferred way, you can also do

    Code:
    if checkbox_name.value = Checked
    if checkbox_name.value = Unchecked

  5. #5
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: checkbox question

    One other option to know about:
    vbGrayed = disables the checkbox
    Last edited by isnoend07; Feb 13th, 2009 at 02:03 PM.
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Jan 2009
    Posts
    166

    Re: checkbox question related question

    What will access 2003 accept as valid values for a yes/no field when using a SQL INSERT statement over an ADO Connection to send information to the table?

  7. #7
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: checkbox question related question

    Quote Originally Posted by vbguy2008
    What will access 2003 accept as valid values for a yes/no field when using a SQL INSERT statement over an ADO Connection to send information to the table?
    I'm not a database guy, but i think it would be true or false. Database person will probably give an answer
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: checkbox question

    It definitely supports the keywords True and False, eg: "...WHERE MyField = True"

    It may also support the numeric values 1 and 0, and the strings Yes and No.

Posting Permissions

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



Click Here to Expand Forum to Full Width