Home » Category » Database & Application Miscellaneous

Database & Application Miscellaneous: Yes/No in access

104| Tue, 04 Dec 2007 06:58:00 GMT| rincewind| 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 & Tags: access, database, application

URL: http://database.itags.org/database-application/158084/
 
«« Prev - Next »» 3 helpful answers below.
Remove the single quotes...

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

cheers chap you're a legend

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

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

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

Database & Application Miscellaneous Hot Answers

Database & Application Miscellaneous New questions

Database & Application Miscellaneous Related Categories