[AccessD] Copy a record in a table

Stuart McLachlan stuart at lexacorp.com.pg
Tue Nov 14 22:24:24 CST 2006


On 14 Nov 2006 at 20:08, Beach Access Software wrote:

> Stuart:
> 
> I'm using
>         db.Execute "INSERT INTO tblJobMaster SELECT tblJobMaster.* FROM
> tblJobMaster " _
>      & "WHERE fldJobMasterID = " & rstJobMasterEquipmentIn!fldJobMasterID
> 
> But I get the cryptic 'Too few parameters.  Expected 1'.  Can you see what
> I'm doing wrong?

WHile developing, try using

strSQL = .....
Docmd.RunSQL strSQL
instead of .Execute.

You get much more helpful error messages that way.

Just a WAG but  is fldJobMasterID a PK or constrained to being unique?

Creating a new record like this, you are trying to create another record in the table with ALL of the fields the same, including any 
unique fields,PK or otherwise.  (You did ask originally to "duplicate" a record in a table) 











More information about the AccessD mailing list