Results 1 to 6 of 6

Thread: SQL Sentence in VB-GOING MAD!!!!

  1. #1

    Thread Starter
    Hyperactive Member Blacknight's Avatar
    Join Date
    Nov 2002
    Posts
    381

    Resolved SQL Sentence in VB-GOING MAD!!!!

    I use the following code and get "Syntax error in update statement". I have tried modifying but to no avail, HELP!!!!
    VB Code:
    1. If SetI(Index).Value = 1 Then
    2. acn.Execute ("update settings set " & settings.Fields(Index).Name & " =  " & True & "   ")
    3. Else
    4. acn.Execute ("update settings set " & settings.Fields(Index).Name & " =  " & False & "  ")
    5. End If
    1.SETI is just an index of checkboxes
    2.when it erroed, settings.fields(index).name was the name of the field I wanted to change
    3.settings is a table of one line containing 5 fields of boolean fields
    4.darn this!!!!
    Last edited by Blacknight; Oct 26th, 2004 at 06:59 PM.

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629
    Are there spaces in the field names? You'll needto enclose in [] brackets for an access database if so.

    BTW, is that ADO or DAO?

  3. #3

    Thread Starter
    Hyperactive Member Blacknight's Avatar
    Join Date
    Nov 2002
    Posts
    381
    There are no spaces in the name. the name is language. I am using ADO.

  4. #4

    Thread Starter
    Hyperactive Member Blacknight's Avatar
    Join Date
    Nov 2002
    Posts
    381
    could that be a saved name?

  5. #5

    Thread Starter
    Hyperactive Member Blacknight's Avatar
    Join Date
    Nov 2002
    Posts
    381
    Yep, thats the problem. It suddenly donned on me that it error on a specific index which wasn't even called, which led me to believe it was a saved name.

  6. #6

    Thread Starter
    Hyperactive Member Blacknight's Avatar
    Join Date
    Nov 2002
    Posts
    381
    Thank god, I was just about to bang my head very hard on the wall.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width