SQL Statment Failure

HowardChr

Noob
Local time
Today, 11:57
Joined
Apr 26, 2007
Messages
35
Hello again all... Today's problem is as follows.... I have an "after update" combo box that is coded as "CurrentDb.Execute "uno", dbFailOnError". I have an SQL Query named "uno" that is showing the following: "UPDATE [Input] SET [Input].Loc_Lng = [Loc-1L].Combo8, [Input].Loc_ID = "1", [Input].Loc_Desc = "xxxx";" I am trying to have the combo box update the values from the combo box into a blank table. When I try to run this, it comes up with the error: "Too few parameters. Expected 1". Any idea what that means, and then how to fix?
 
Hi,
An update query updates an existing row whereas an append query is used to add NEW rows to a table.

Hint do not use Access reserved words ie Input.
Prefix all tables with tbl
Prefix all queries with qry
Prefix all Forms with frm
Do not use access default names
prefix combo boxes with cbo.

what is this referring to

[Loc-1L].Combo8

is it the contents or a combo box on a form, if it is then you refer to a form and control like this

Forms!YourFormName!YourControlName

or me!YourControlName
if the code is in the a code module of the form.
 
OK, I think I've got the right idea, however still getting the same error message. When I run the query from the query, it works the way I intend it to, however when I select an option from the combo box on my form, It gives me the same error: "Too few parameters. Expected 1", and refers to my 'on update' command: "CurrentDb.Execute "Uno", dbFailOnError"
 

Users who are viewing this thread

Back
Top Bottom