How do you update a checkbox? This is what I have, but it doesn't work:
Thanks!Code:Update_tblCapRec = "UPDATE tblCapRec SET InGDB = cbInGDB.Checked WHERE CaseNumber='" & txtCaseNum.Text & "'" & " AND PartNumber ='" & txtPartNum.Text & "'"
Printable View
How do you update a checkbox? This is what I have, but it doesn't work:
Thanks!Code:Update_tblCapRec = "UPDATE tblCapRec SET InGDB = cbInGDB.Checked WHERE CaseNumber='" & txtCaseNum.Text & "'" & " AND PartNumber ='" & txtPartNum.Text & "'"
What is the datatype of InGDB?
Regardless, you need to concatenate the vaule of the CheckBox to the SQL string, like you do for the Case and Part Numbers.
Update_tblCapRec = "UPDATE tblCapRec SET InGDB = " & cbInGDB.Value & " Where ....
.Value doesn't work and neither does this:
" & cnInGDB.Checked & "
What else can I do?
What other things could it be?Code:Update_tblCapRec = "UPDATE tblCapRec SET InGDB = " & cbInGDB.Checked & " WHERE CaseNumber='" & txtCaseNum.Text & "'AND PartNumber ='" & txtPartNum.Text & "'"
.CheckState???
HELP! Thanks!
.CheckState works perfect! Thanks!
Do you understand why CheckState works but not Checked.
Or do you even care?
I think one equals a value of 1 or 0 and the other True or False. Is that right? That is what it said when I was debugging.