Does each item have it's own record in Item_tbl. What I mean, if you have 2
widgets, Is there one record that describes widgets that share a Code
with an on hand quantity or are there two records, one for each widget and
each widget has it's own Code?
In which table do you keep track of who has a widget on loan? Conversly,
how do you know which Clients have widgets on loan?
Typically, if all widgets share a code, then you would use a combination of
3 tables
Client_tbl - Info about clients
Iten_tbl - Info about items (includings quantity on hand)
ClientItem_tbl - A Join table that will tell you who has which items on loan
Client would logically be a many to many relationship to Items because 0 to
many clients may have 0 to many Items on loan.
ClientItem resolves the many to many. Client_tbl is one to many to
ClientItem_tbl and Item_tbl is one to many to ClientIten_tbl.
In the case where each widget has its own record, then you will want two
tables, ItemHeader_tbl and Item_tbl. The ItemHeader describes what a widget
is and the Item describes a specific widget. They would share a Widget Code,
but would each have a unique Widget Serial Number. So ItemHeader_tbl would
be one to many to Item_tbl. Client_tbl would still be one to many to
Item_tbl, but there would be no need for the ClientItem_tbl.
As to quantities. In the first case, quantities would be in Item_tbl. There
would be a Total Quantity that would show how many widgets there are. There
would be an Available Quantity which would be Total Quantity - the number on
loan - number held back for repair, reserved, or what other reasons one item
might not be available. So each time a client takes a widget out on loan,
you would subtract 1 from Available Quantity and when it is returned you
would add 1 to Available Quantity. If a widget were disposed of, you would
subtract 1 from total quantity and 1 from available quantity. If a new
widget were acquired, you would add 1 to both.
Hope this helps. If you have questions, please post back.