Update Syntax Error

L

Les

Despite repeated attempts I cant master this Update syntax

All I want to do is update one field in its own table. Having attempted
numerous combinations I still get "Expected parameter error 1"

I have stopped the code and viewed the intItemsInList variable and it looks
ok to me. But obviously not OK!

Can someone please guide me on this thanks

Les

Dim intItemsInList As Integer
intItemsInList = numNumber_of_Order_Items

strsql = "Update tblItem_Count Set numQuantity = " & intItemsInList

CurrentDb.Execute strsql, dbFailOnError
 
C

Chris

Here is what I do:

Dim intItemsInList As Integer
intItemsInList = numNumber_of_Order_Items

strsql = "Update tblItem_Count Set numQuantity = " &
intItemsInList

'Print the SQL string we're trying to run.
Debug.Print strsql

CurrentDb.Execute strsql, dbFailOnError


Now, in the debug window, copy/paste the sql code into a
new query. Try running it there. You should get a
parameter box asking for value. What name is there? That
is where the problem is.

Usually, this error occurs becuase the numQuantity field
either doesn't exist, or it is spelled wrong. Pasting the
SQL code helps you find it.


Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top