Database & Application Miscellaneous: Yes/No in access

  • rincewind / 104 / Fri, 29 Jan 2010 19:09:00 GMT / Comments (3)
  • I have a table in access which has a check box (yes/no). i want to match the value of that check to a check box in VB 6.

    i'm sure that the access check box outputs a true or false value in VB and the check box in VB is either 0 or 1. So i have made it so that if the check box in vb is 1 then a boolean var = true. All i wanted to do then is match that var with value of check box in access. So i wrote this

    GetData ("SELECT * FROM tblpitch WHERE electric = ' " & vbelectric & " ' ")


    getdata is a procedure which connects to the database and works fine with all my other sql statements.

    'electric' is set to 'yes/no' in access
    'vbelectric' is set to either true or false in vb

    everytime i run this piece of code i get the error...

    unable to connect
    data type mismatch in criteria expression.

    coudl someone please tell me what is wrong with the sql code, or what else i have done wrong. thanks alot
  • Keywords:

    access, database, application

  • http://database.itags.org/database-application/158084/«« Last Thread - Next Thread »»
    1. Remove the single quotes...

      dee_u | Wed, 05 Dec 2007 19:18:00 GMT |

    2. cheers chap you're a legend

      rincewind | Wed, 05 Dec 2007 19:19:00 GMT |

    3. You can now mark this thread as resolved... :)

      dee_u | Wed, 05 Dec 2007 19:20:00 GMT |