
Subtracting qty from a field on one table from qty used on another table
Here is the structure of the
database, as I have it.
Table1 "MasterInventory"
HangerID (keyfield)
Qty
Table2 "HangersPerJob"
Index (keyfield)
JobNumber
HangerID
QtyUsed
Table 3 "HangersOrdered"
Index (keyfield"
HangerID
QtyRcvd
PONumber
I have a one-to-many relationship from MasterInventory to HangerPerJob based
on the HangerID field. I also have a one-to-many relationship from
MasterInventory to HangersOrdered based on the HangerID field.
Both relationships are set to (#1, only include rows where the joined fields
from both tables are equal) they both have "enforce referential entegrity"
checked, "cascade update checked, "cascade delete checked.
I have a query "query1" that includes MasterInventory.Qty &
HangersPerJob.QtyUsed & MasterInventory.HangerID & HangersPerJob.HangerID
????? is this right????
My intention was to make two forms, one for entering records to the
HangersPerJob table, the second for entering records to the HangersOrdered
table.
The Hangers per job could have many different hangers per job#.
The question is how do I enter info into the second table and have it
subtract quantities from the first table based on the quantity used in the
second table?
Help Please