Calculate error when one-to-many replationship is added

  • Thread starter EMILYTAN via AccessMonster.com
  • Start date
E

EMILYTAN via AccessMonster.com

Hi everyone,

Table 1
ItemId (primary key)
ItemName
ItemDescription

Table 2
Bil
ItemID
Quantity Received

Table 3
No
ItemID
Quantity In

I Create a query for each of the tables.
which sums Quantity Received, Quantity In, Quantity Out
I create another query which will add the Items table (table 1) and the other
3 queries summing up
the items, joining the 3 queries to the Items table by ItemID using Join 2
(show all the fields in TblItem) for each join.
Add eg ItemID, Item Name from the Items table then, from the other 3
queries, SumOfQuantity Received, SumOfQuantity In, SumOfQuantity Out
the Query.
In another column i have a formula like
ItemResult: NZ(SumOfQuantity Received) + NZ(SumOfQuantity In) -
NZ(SumOfQuantity Out)

I work well and it gave me result like:-

Item - Apples
SumOfQuantity Received - 10
SumOfQuantity In - 2
SumOfQuantity Out - 4
TotalQuantity - 8

Item - Bananas
SumOfQuantity Received - 8
SumOfQuantity In - 2
SumOfQuantity Out - 6
TotalQuantity - 4

However, when I add in another Loan table and and add one more Loan ID field
in table 2, it totaly can't work...any idea

Loan table
LoanID(PK)
LoanDesc

Table 2
Bil
LoanID
ItemID
Quantity Received
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top