By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,193 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

UPDATE query not working for checkbox

P: 18
Hello,

I'm updating a table with this query:

Expand|Select|Wrap|Line Numbers
  1.  UPDATE SavedQueries SET column = '" & strColumnData & "', sort_by = '" & strSortByData & "' WHERE name = cmbQName.Value
This works fine and does what its supposed to. But as soon as I add 1 field to be updated too, I get an error 3144 "Syntax error in UPDATE statement":

Expand|Select|Wrap|Line Numbers
  1.  UPDATE SavedQueries SET general = " & chkGeneral.Value & ", column = '" & strColumnData & "', sort_by = '" & strSortByData & "' WHERE name = cmbQName.Value
chkGeneral is a checkbox, and it's value should be written to the table. The checkbox is set to True/False format. I've tried a lot of different syntaxes like:
Expand|Select|Wrap|Line Numbers
  1. general = '" & chkGeneral.Value & "'
  2. general = chkGeneral.Value
but I always get the same error. Just to check I've also tried things like:
general = TRUE
general = Yes
general = 1
with any combination of quotes, to no avail.

Can anyone help me?
Aug 15 '08 #1
Share this Question
Share on Google+
1 Reply


P: 18
Problem solved, it seems "general" is a reserved word. Can not use it for objects or field names apparently. I changed "general" into something else and it works now
Aug 15 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.