Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2013
    Posts
    27

    Making a calculation and where can I put it? Table? Query?

    In my Inventory Database there is a list of Products. Each ProductID has transactions to reduce or add to inventory for that particular Product. One is UnitsReceived. And the other is UnitsUsed.

    I would like to make the calculation to subtract the UnitsUsed from the UnitsReceived. But I want to SUM all of the UnitsReceived and UnitsUsed for each ProductID before subtracting (this would give me "Units on Hand"). This calculation is done on the Product Form right now but I would like to have "Units on Hand" in the Products List as well. (this is in Datasheet view)



    The control source for Units on Hand on the form is "=Sum(nz([UnitsReceived])-nz([UnitsUsed]))". But when I try this in a query it sums ALL of the products so each item shows the same number which is in the thousands.

    So is there a way to create a query that can calculate something like this?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Why do you have to "put it" somewhere?
    Why don't you calculate when needed and display the result.
    General advice is do NOT store calculated values.

    Here is a reference you should read -- at least the first 5 lines.
    http://allenbrowne.com/appinventory.html

  3. #3
    Join Date
    Mar 2013
    Posts
    27
    I would like to put it in the products list because it would be very convenient to see the list of products and how many are in stock for each product all in the same location.

    Right now it is calculated on the Products Form which only shows one product at a time.

    That article says "You calculate the value when you need it." So, when do I need it? Define "need".
    It seems I would need it when I look at a Product in the Product Form.
    Seeing it in the Products List could be more of a convienence factor. Not knowing how many we have in stock unless we open the Products Form seems inconvienent when you have hundreds of products. Could that be categorized as a "need"?

    Perhaps I should try running a report that lists the products and units on hand?.....

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Sounds like an option that would work..

    As for "need", no one can define what need means in your environment better than you or your front line users.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Calculation Field in table vs Query calculation
    By Leonidsg in forum Database Design
    Replies: 18
    Last Post: 02-28-2013, 09:38 PM
  2. Replies: 1
    Last Post: 03-01-2012, 03:53 PM
  3. making a table from a filtered split form
    By stephenaa5 in forum Queries
    Replies: 2
    Last Post: 08-25-2010, 08:56 PM
  4. Replies: 4
    Last Post: 03-04-2010, 06:26 AM
  5. Making a backup copy of table or database
    By wasim_sono in forum Access
    Replies: 0
    Last Post: 03-09-2006, 05:44 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums