D
DoDev
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 in two tables
(tblC.XID, 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
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 in two tables
(tblC.XID, 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