I haven't dabbled in Access for a little while now, so I'm having trouble going back and fixing an erroneous database. It uses a check-in, check-out inventory system that then takes the total of transactions for each object type to determine current inventory. This query pulls data together for the report, which should display the Electrode ID, the Parts it corresponds with, the Customer name, Qty On-Hand, Qty out for replate, and total qty:
The problem is, if someone adds an Electrode to the database that does not exist in the existing Electrodes table (which defines the electrode's corresponding Parts) then it will not appear in the report. This is the query for the report:
Code:
SELECT tblTransactions.Electrode, Sum(([Qty In]-[Qty Out])) AS OnHand, Sum(([Replate In]-[Replate Out])) AS OutForReplate, tblInventory.partID, tblParts.[Customer Name]FROM tblParts INNER JOIN (tblInventory INNER JOIN tblTransactions ON tblInventory.electrodeID = tblTransactions.Electrode) ON tblParts.[Part #] = tblInventory.partID
GROUP BY tblTransactions.Electrode, tblInventory.partID, tblParts.[Customer Name]
HAVING (((Sum(([Qty In]-[Qty Out])))<>0));
It should be noted that Parts is a linked table, so it can't be directly modified through this database.
Could I either:
A. Modify this SQL statement so that it includes Electrode entries without matching Parts
B. Make the database automatically open another pop-up form that allows the creation of a new Electrode entry that can be tied to a Part when the electrode does not exist yet
and which would be the better option?
Please ask for any additional information you need if this post isn't clear!
Thanks