B
BruceM
This is the SQL for a query that cannot be updated:
SELECT tblPO.*, tblVendor.*, tblPhone.Phone, tblPhone.MainPhone
FROM (tblVendor INNER JOIN tblPO ON tblVendor.VendorID = tblPO.VendorID)
INNER JOIN tblPhone ON tblVendor.VendorID = tblPhone.VendorID
WHERE (((tblPhone.MainPhone)=True));
The situation, in general terms, is that I have a pretty standard PO system.
There is a Vendor table, with a related Purchase Order (PO) table. If it
matters for purposes of this question, there is a PO_Details table for line
items on the PO, which serves as the junction table between the Vendor table
and a Products table.
The Vendor table also has a related table for phone numbers. Therein lies
my problem. The PO form needs to contain Vendor information including the
phone number, and PO information such as PO_Date and PO_Number. As long as
I leave out the Phone table, everything is fine.
If I make a query consisting of tblVendor and either tblPhone or tblPO,
everything is fine; however, adding both tblPhone and tblPO locks down the
query for reasons I have not been able to discover. I do know that changing
the join type has accomplished nothing. An article in Microsoft's MSDN2
library contains the following as a reason for a non-updatable query:
"Query based on three or more tables in which there is a many-to-many
relationship"
This is the closest I can find to something that applies to my situation, as
tblPO is related to tblPO_Details, which as I mentioned is a junction table.
The article is ambiguous in that it doesn't specify whether the problem lies
with a query that includes the three table involved in the many-to-many, or
just any query with three or more tables, one of which is part of a
many-to-many relationship. If it applies to my difficulties I do not see
the solution.
SELECT tblPO.*, tblVendor.*, tblPhone.Phone, tblPhone.MainPhone
FROM (tblVendor INNER JOIN tblPO ON tblVendor.VendorID = tblPO.VendorID)
INNER JOIN tblPhone ON tblVendor.VendorID = tblPhone.VendorID
WHERE (((tblPhone.MainPhone)=True));
The situation, in general terms, is that I have a pretty standard PO system.
There is a Vendor table, with a related Purchase Order (PO) table. If it
matters for purposes of this question, there is a PO_Details table for line
items on the PO, which serves as the junction table between the Vendor table
and a Products table.
The Vendor table also has a related table for phone numbers. Therein lies
my problem. The PO form needs to contain Vendor information including the
phone number, and PO information such as PO_Date and PO_Number. As long as
I leave out the Phone table, everything is fine.
If I make a query consisting of tblVendor and either tblPhone or tblPO,
everything is fine; however, adding both tblPhone and tblPO locks down the
query for reasons I have not been able to discover. I do know that changing
the join type has accomplished nothing. An article in Microsoft's MSDN2
library contains the following as a reason for a non-updatable query:
"Query based on three or more tables in which there is a many-to-many
relationship"
This is the closest I can find to something that applies to my situation, as
tblPO is related to tblPO_Details, which as I mentioned is a junction table.
The article is ambiguous in that it doesn't specify whether the problem lies
with a query that includes the three table involved in the many-to-many, or
just any query with three or more tables, one of which is part of a
many-to-many relationship. If it applies to my difficulties I do not see
the solution.