To few parameter error on Update

L

Les

I am getting the following output from Print Debug from ther code below. I
can't understand why it is giving me the error.

The "curRunninng_Sum field is Currency and the Product field is text. I am
at a loss as I have a sinilar code working perfectly in another table.

Any Ideas would be greatfully recieved.

Les

'Output from Print debug
Update tblOrder_Details Set curRunning_Sum = 3.5 WHERE Product = 'C6125'

Dim Runtot As Currency
Dim strsql As String
Dim PCode As String

Runtot = 0

Set Sumlist = CurrentDb.OpenRecordset("tblOrder_Details") 'table Name
PCode = Sumlist!strProduct_Code

If Sumlist.BOF Then 'BOF=no results from tbl
MsgBox "There Are No Calculations To Be Made."
Else

Sumlist.MoveFirst

Do
Runtot = Runtot + Sumlist![curTotal]
strsql = "Update tblOrder_Details Set curRunning_Sum = " & Runtot & "
WHERE Product = '" & PCode & "'"

Debug.Print strsql

CurrentDb.Execute strsql, dbFailOnError

Sumlist.MoveNext

Loop Until Sumlist.EOF

End If
 

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