To few parameter error on Update

  • Thread starter Thread starter Les
  • Start date Start date
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
 
Back
Top