help with sql update statement

antonyx

Arsenal Supporter
Local time
Today, 20:52
Joined
Jan 7, 2005
Messages
556
hi.. i want to set a number field (fkPaidID) to 1

this syntax is wrong.. ive looked at a few examples..

could someone explain what is wrong with this statement

Code:
CurrentDb.Execute "UPDATE tblJob SET [tblJob].[fkPaidID] = 1 WHERE tblJobInvoice.fkInvoiceRef = '" & Me.txtInvoiceRef & "' AND tblJobInvoice.fkJobRef = tblJob.JobRef;"

http://www.londonheathrowcars.com/here.jpg

basically im trying to set the fkpaidid to 1 when the invoice status is set to paid
 
run time error 3061

too few parameters. expected 2
 
Try Docmd.RunSQL instead of currentdb.execute. I know the Docmd.RunSQL can do what you need, but am unfamiliar with currentdb.execute
 
split the string if the number appears in between. The example is
"update <tablename> set <fieldname> = " & <number> & " where <condition>"
 

Users who are viewing this thread

Back
Top Bottom