4 Replies - 935 Views - Last Post: 13 November 2011 - 09:06 PM Rate Topic: -----

#1 konk353535  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 165
  • Joined: 04-December 08

Keep getting syntax error for update statement

Posted 12 November 2011 - 03:39 PM

Been trying to fix this for 2 hours now and its buggying me i cant see anything wrong with the below syntax ive used a very similar syntax in other updates and it works

dbs.Execute "UPDATE BatchNumber " _
        & "SET Number=Number+1 " _
        & "WHERE  ID=1;"



thanks for reading please reply if u need any other peices of code

btw (ive declared dbs and used it in the same form and it worked so its not the dbs)

Is This A Good Question/Topic? 0
  • +

Replies To: Keep getting syntax error for update statement

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8382
  • View blog
  • Posts: 31,155
  • Joined: 12-June 08

Re: Keep getting syntax error for update statement

Posted 12 November 2011 - 03:49 PM

What's the syntax error your are receiving?
Was This Post Helpful? 0
  • +
  • -

#3 konk353535  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 165
  • Joined: 04-December 08

Re: Keep getting syntax error for update statement

Posted 12 November 2011 - 11:11 PM

View Postmodi123_1, on 12 November 2011 - 03:49 PM, said:

What's the syntax error your are receiving?


RunTime-error 3144

syntax error in update statement

thats it gah its frustrating
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8382
  • View blog
  • Posts: 31,155
  • Joined: 12-June 08

Re: Keep getting syntax error for update statement

Posted 13 November 2011 - 02:14 AM

Try throwing "dbo." in front of the table name.
Was This Post Helpful? 0
  • +
  • -

#5 guyfromri  Icon User is offline

  • D.I.C Addict

Reputation: 46
  • View blog
  • Posts: 805
  • Joined: 16-September 09

Re: Keep getting syntax error for update statement

Posted 13 November 2011 - 09:06 PM

The syntax looks good...I did notice an extra space between the WHERE and ID=1 -- maybe that simple but if not are you sure the number field is formatted as a number?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1