Showing a sum in a form based on a query or another table

  • Thread starter Thread starter Ulv
  • Start date Start date
U

Ulv

I don't get it !!! Stupid, stupid, stupid

I have 2 tables.


TblPostings:
Id, autonumber, key
BlockNo, text
NoofItems


TblItem:
BlockNo, text, key
etc..

I have a form called FrmItem that has the TblItem records.


I need a field in FrmItem showing NoofItems per BlockNo in
TblPostings
I have to be able to filter the form based on that value later.


TblPostings
BlockNo NoofItems
44333 1
44334 -1
44333 -1
44335 -1
44333 -1


TblItem new field in form
44333 -1
44334 -1
44335 -1


Pls help !!
 
Try this ---
SELECT TblItem.BlockNo, TblItem.etc, Sum(TblPostings.NoofItems) AS
SumOfNoofItems
FROM TblPostings RIGHT JOIN TblItem ON TblPostings.BlockNo = TblItem.BlockNo
GROUP BY TblItem.BlockNo, TblItem.etc;
 
Try this ---
SELECT TblItem.BlockNo, TblItem.etc, Sum(TblPostings.NoofItems) AS
SumOfNoofItems
FROM TblPostings RIGHT JOIN TblItem ON TblPostings.BlockNo = TblItem.BlockNo
GROUP BY TblItem.BlockNo, TblItem.etc;

--
KARL DEWEY
Build a little - Test a little













- Show quoted text -

Thanks for all help. I managed to create a query and then used
dlookup ....
 
Back
Top