PDA

View Full Version : Depulicate insert query error



Trevor
04-09-2008, 01:06 PM
I am trying to run an insert query where there are 3 entry's into 2 colums of the same value, and I get a duplicate insert query error, thanks for helping

DoCmd.RunSQL "Insert InTo [IndividualSettingsTbl] (UserName,UserName,UserName)" _
& " Values ('" & AccountName & "','" & AccountName & "','" & AccountName & "');"
' the reason behind this multiple inert is becaue it is for more then 1 lookup accociated with that table, which will be called to later)

thanks for helping

Trevor
04-09-2008, 01:29 PM
Is there a way to do this without running multiple single inert queries?

Carl A
04-09-2008, 01:35 PM
Just guessing at your error code:

Duplicate output destination <name>. (Error 3063)

You tried to execute a query that contains more than one destination field with the same name.

Possible cause:


You created an SQL statement that includes an INSERT INTO, SELECT...INTO, or UPDATE statement that lists the specified field name more than once.

Remove the duplicate fields or alias the destination field names, and try the operation again.

Trevor
04-09-2008, 03:52 PM
CarlA, it works if I do multiple single insert queries , I'm asking if there is a way to do this all in 1 insert query?, I doubt it though