Error: Duplicate Output Destination

D

DoDev

I tried to post the same question in the Queries thread however I do not see
it listed. I appologize if it turns out that i am posting a duplicate
question.

In Visual Basic I get a duplicate output destination error for the following
query

SELECT *
FROM tblB INNER JOIN (tblD INNER JOIN (tblC INNER JOIN tblA ON tblC.WID =
tblA.ZID) ON tblD.XID = tblC.XID) ON tblB.YID = tblA.YID
WHERE (((tblA.WID)=129) AND ((tblC.XID)=1))

Access is complaining about the XID field which is defined both in tblC.XID
and tblD.XID

Please notice the tables are inner joined through XID field so in the query
result in each row I have only one (unique) value of XID. Instead of using
SELECT *, I can solve the problem by individually listing in the SELECT
statement all the fields, including either tblC.XID or tblD.XID. However,
the statement would be very long, tedious to create and it would be painful
to maintain. In the future, each time I define a new field in any of the
tables I will have to remember to add the new field to the query.
By the way, I tested the query outside of Visual Basic. When I run exactly
the same query in Access Query Editor it works fine and produces desirable
results.
Any ideas on how I can solve the problem?

Thanks for your help.
DoDev
 
T

Tom van Stiphout

On Sat, 9 Jan 2010 09:18:01 -0800, DoDev

I didn't test this, but I would think this would help:
select tblA.*, tblB.*, tblC.*, tblD.* from ...etc.

-Tom.
Microsoft Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top