• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 37
  • Last Modified:

Duplicate output destination 'data' when using expression in source

I have a simple append query add tbl1.key, and a constant 3333 to tbl2.key  & tbk2,data.  
It does not run. it  generates this error

Duplicate output destination 'data'.
If I remove the 2 column there is no error message.

Here is a screen shot
example
0
rberke
Asked:
rberke
  • 3
  • 3
  • 2
  • +1
1 Solution
 
PatHartmanCommented:
What table are you appending to?  Does it have a column named conmember?  Please post the SQL rather than the picture.
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
hi,

While the picture is nice, I agree with Pat -- the SQL would be a huge help ... as would the fields and data types in tblInvoices ... and the logic for using an existing records to add new records in the same table ... do you mean to have some criteria?  It seems this would add another record for every record that is already there with a literal value for conmember being what is specified by the calculated field.

What does InvEntityNum represent? And what are examples of its values?

Disregarding your explanation, since it is different than the screenshot ... can't see query properties such as Output All Fields, ... and maybe something is there but not showing. Without the SQL, it is not obvious to see how the duplicate destination is being specified.

to switch to the SQL view so you can post the SQL statement:

  • choose SQL View from the View drop-down, which is the first icon on the HOME ribbon.
  • You can also right-click in the design view on a spot that is not another object like a column or a fieldlist, and choose "SQL View" from the shortcut menu.

SQL is text that you can copy and paste into a message. Make sure you don't inadvertently change it. Undo is Ctrl-Z.

~~~
what is the data type for the problematic field?

~~~
If the problem was that this had run before and data rules were being violated, the error message should be something else. Seeing the SQL statement should clear things up.

~~~
> "If I remove the 2 column there is no error message."

if you remove them, what happens? Does data get added?

~~~

It appears that it is desired to add another detail row for someone ... are any of the other fields in the table design required? Wouldn't a date be required for an invoice? If this is a detail line for an invoice that already exists, it should be in a related table and there should be more information.

Or maybe the error message is wrong.

What is the primary key for tblInvoices? If an AuoNumber, you don't have to worry about filling it.

~~~
what is the source for the value of conmember? A control on a form? something else?

have an awesome day,
crystal
0
 
Gustav BrockCIOCommented:
You have included * in your SQL, like:

INSERT INTO tblInvoices ( InvoiceEntityNum, conmember )
SELECT *, tblInvoices.InvoiceEntityNum, 44444 AS Expr1
FROM tblInvoices;

Open in new window

Remove the star:

INSERT INTO tblInvoices ( InvoiceEntityNum, conmember )
SELECT tblInvoices.InvoiceEntityNum, 44444 AS Expr1
FROM tblInvoices;

Open in new window

1
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
rberkeConsultantAuthor Commented:
Everyone suggested "give us the sql" which is I should have done in the first place.

But Gustov went one step farther and said "you have included * in your sql"

That is exactly right.  Even though the * does not show up in Design Layout, it does show up in SQL view.  I removed it and things are back to normal.  

Normally I would give some points to the other commenters, but I cannot see the option to dp so.   I think the EE interface is undergoing changes.
0
 
PatHartmanCommented:
Gus is a good guesser because that's what he had to do to provide your solution.

It isn't necessary to give participation points to everyone else.  Splitting the award is appropriate when more than one person helped to get to your answer (the interface does allow you to do it.  You just check more than one post as assisted).  Splitting just to be nice punishes the person who actually did help.  How is that fair?    Gus guessed the answer and so deserves the points.
0
 
Gustav BrockCIOCommented:
I've seen it more than once and always wondered, why the designer will not show the column with the lonely star.
If you put tablename.*, it will show.

So, I didn't even have to guess.

Have a nice weekend!
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
> "Even though the * does not show up in Design Layout"

yes it does -- on the property sheet. It is called "Output All Fields", which was my guess too ... in that rather wordy post ~ but maybe you glossed over that because the paragraph starts with "Disregarding your explanation"
0
 
Gustav BrockCIOCommented:
You are right. It does show in the property sheet. Forgot that.

But I never use that for adjusting the SQL, only for adjusting "true" properties of the query. Maybe I should change that habit.
0
 
PatHartmanCommented:
We all knew the answer was something we were not seeing.  Gus took a stab at the problem and was correct.
0
 
rberkeConsultantAuthor Commented:
I now see that the "assisted answer" button  is only available in EE "Classic View".  It it is being replaced by a similar concept of "was this helpful?"  which still awards points, but does some of the math automatically.  

The details are a still a little vague, but I support the concept.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now