Note that there are some explanatory texts on larger screens.

plurals
  1. POJoin -- NOT (A2007)
    primarykey
    data
    text
    <p>I have a classic two-listbox form construct (Move a row from this box to that box...) I want the box to the left to contain all rows that are NOT in the box on the right.</p> <p>The underlying data is in a many-to-many relationship. PartNbr -- XREF -- Source, where a part may have 0 or more sources...so I have three tables, Item Master, XREF, and Source (aka "TP") table. The box on the right selects all partnbrs from the Item Master that have records in the XREF table, and shows them in the box on the right.</p> <p>The box on the left should show all other parts in the TP (Third Party)item master (Sourcable parts) that are NOTin the box on the right. Since it's a many-to-many relationship, I've used the SELECT DISTINCT construct. Herewith the rowsources for the two boxes:</p> <p>Left ("From") box:</p> <pre><code>SELECT DISTINCT tblTPitemMaster.TPItemID, tblTPitemMaster.TPItemVendorID, tblTPitemMaster.TPItemNbr, tblTPitemMaster.TPItemDescription, tblTPitemMaster.TPItemUnitCost, tblXrefItemTPItem.TPXRCPASItemID FROM tblTPitemMaster LEFT JOIN tblXrefItemTPItem ON tblTPitemMaster.TPItemID = tblXrefItemTPItem.TPXRTPItemID WHERE ((TPItemVendorID=590) AND (TPXRCPASItemID &lt;&gt; 10546)) ORDER BY tblTPitemMaster.TPItemVendorID </code></pre> <p>Right ("To") Box:</p> <pre><code>SELECT tblXrefItemTPItem.TPXRPreferredVendor AS Rank, tblVendor.[Vendor Name], tblTPitemMaster.TPItemNbr, tblTPitemMaster.TPItemDescription, tblTPitemMaster.TPItemUnitCost, tblXrefItemTPItem.TPXRID FROM tblVendor INNER JOIN (tblTPitemMaster INNER JOIN tblXrefItemTPItem ON tblTPitemMaster.TPItemID = tblXrefItemTPItem.TPXRTPItemID) ON tblVendor.ID = tblTPitemMaster.TPItemVendorID WHERE TPXRCPASItemID=10546 ORDER BY tblXrefItemTPItem.TPXRPreferredVendor </code></pre> <p>Problem is, I get every TPItem master record in the left box. Must be something simple. Ideas?</p> <hr> <p>Jim</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload