From: Roger on
On Mar 25, 11:57 pm, "Poul" <givskov(nospam)@adslhome.dk > wrote:
> Roger wrote:
>
> > I would use the following tables, not need to capture totals since it
> > can be
> > calculated using a query (or two)
> > tblItem
> > itemId
> > description
> > qtyOnHand
>
> > tblItemTransaction
> > transactionId (autonumber)
> > itemId
> > transType (S - sale, P - purchase, A - adjustment)
> > transDate
> > transQty
> > transCost
> > transPrice
>
> > qryTransQty
> > -----------
> > select itemId
> >      , sum(IIf(transType = 'S', -transQty,
> >            IIf(transType = 'P', transQty,
> >            transQty) as tQty
> >   from tblItemTransaction
> >  group by itemId
>
> > qtyQtyOnHand
> > ------------
> > select tblItem.itemId
> >      , tblItem.qtyOnHand + qryTransQty.tQty as onHand
> >   from tblItem left join
> >        qryTransQty on tblItem.itemId = qryTransQty.itemId
>
> > the reason, tblItem as qtyOnHand, it allows you to flush transactions
> > out of tblItemTransaction and store the next quantity as qtyOnHand
>
> > of course, the flushing activity needs to deal with costing, be it
> > average cost, fifo cost, last cost,....
>
>  Hello Roger
> As I write I'm totaly newbee in access, is the first two parts tables,
> and the last tow sections is this queryes?
>
> Poul
>
> Is this table one?
>
>   tblItem> itemId
> > description
> > qtyOnHand
>
> --
>
> and this table two?
>
>
>
> > tblItemTransaction
> > transactionId (autonumber)
> > itemId
> > transType (S - sale, P - purchase, A - adjustment)
> > transDate
> > transQty
> > transCost
> > transPrice- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

yes to all your questions
From: "Poul" givskov on
Roger wrote:
>
> yes to all your questions

Thank you Roger you have been at great help.

Poul

--