Need Help executing an update in form

ismith

Registered User.
Local time
Today, 21:05
Joined
Dec 14, 2011
Messages
30
Hello,

Ive got a form where a customer can place an order. now at the bottom i want to put an execute statement which will look at the product ID that has been ordered and make sure that it dont allow that one to be entered again. This is the coding ive got atm to do that:

Code:
db.Execute "UPDATE tblProduct SET chosen = True WHERE ProductID = " & cmbProductID

the error message im getting is:
Run-time error '3061': Too few parameters. Expected 1.


anyone know how i can sort this out?

Thanks..
 
Anyone know whats wrong?

Need urgent help..
 
I don't see any problems with that line of code but here are some suggestions:

1.If ProductId is a text field you need to change your sql to
"update tblProduct set chosen = True where ProductID = '" & cmbProductId & "'"

2.Try adding the optional dbFailOnError to your command
"update tblProduct set chosen = True where ProductID = " & cmbProductID,dbFailOnError

3.Run compact and repair on your database just to make sure there aren't any corrupt indexes.
 

Users who are viewing this thread

Back
Top Bottom