insert into yes/no field of ms access in

Do you use 'true' and 'false' or 'checked' and 'unchecked' or 1 and 0??
Who is Participating?
Wayne Taylor (webtubbs)Connect With a Mentor Commented:
Have you specified the fields?

    Dim sql As String = "insert into actions ([Field1], [Field2], [Field3], [Field4]) VALUES ('main','PART INSPECTION',true,false)"

ddepuemdAuthor Commented:
this dors not work;

Dim sql As String = "insert into actions ('main','PART INSPECTION',true,false)"
you can use True and False  but better to use 0 and 1 (-1)

ddepuemdAuthor Commented:
Both methods gives me a syntax error. do I put single quotes around?
Jorge PaulinoIT Pro/DeveloperCommented:
Do you have two fields ? you're trying to insert two fields!
You also should change the connection string indicating the fields and the values to insert. If you have an autonumber field you don't use it in the connection string because it's automatically filled
Dim sql As String = "insert into actions(field1, field2, field3) VALUES (value1,value2,value3)"
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.