[AccessD] Copy a record in a table

Beach Access Software bchacc at san.rr.com
Tue Nov 14 23:10:56 CST 2006


Oops.  My bad.  fldJobMasterID is an the Autonumber PK of tblJobMaster.
Won't work then, will it?

Rocky


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Stuart McLachlan
Sent: Tuesday, November 14, 2006 8:24 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Copy a record in a table

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) 








-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.14.5/534 - Release Date: 11/14/2006
3:58 PM
 




More information about the AccessD mailing list