Results 1 to 6 of 6
  1. #1
    oscarmolivera is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Location
    maracaibo, Venezuela
    Posts
    4

    Dynamic total ItemInStock


    Hello, I trying to make an inventory Db. and I'm stuck in something that I belived is quite easy but I can't solve it.

    How can I make a dynamic total?

    Here's the example.

    When someone sales an item, it has to shown the quantity of that item has been reduce. The query shoud show something like this:

    Code:
    IDItem	Description	SalesDate	IDSalesman	SaleQty	ItemInStock
    256	DVD plug	12/09/2010	3	1	45
    256	DVD plug	15/09/2010	3	1	44
    256	DVD plug	21/09/2010	3	1	43
    256	DVD plug	01/10/2010	3	3	40
    256	DVD plug	05/10/2010	2	1	39
    256	DVD plug	11/10/2010	2	1	38
    256	DVD plug	19/10/2010	2	2	36
    Other thing is that I really want to learn, so if any can point some good book for learning it will most apreciated (I've already finnish the video course from Lydia.com)

    Thanks for the help.

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    the Qty on hand should be displayed in the master inventory table (the one where you have only on record per ItemID). everytime a sale is made, there should be a a bit of code that will subtract the qtySold from the qtyOnHand.

  3. #3
    oscarmolivera is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Location
    maracaibo, Venezuela
    Posts
    4
    Thanks for your answer.
    I really apriciated.
    I think I've already did this, but it keep subtracting from the main total like this:
    Code:
    IDItem	Description	SalesDate	IDSalesman	SaleQty	ItemInStock
    256	DVD plug	12/09/2010	3	1	45
    256	DVD plug	15/09/2010	3	1	45
    256	DVD plug	21/09/2010	3	1	45
    256	DVD plug	01/10/2010	3	3	43
    256	DVD plug	05/10/2010	2	1	45
    256	DVD plug	11/10/2010	2	1	45
    256	DVD plug	19/10/2010	2	2	44
    please tell me what am I doing wrong, or how I have to re-think this

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    you shouldnt have each sale in the same table as your main item table. Read up on Normalization. It's really way too much for me to try to explain here. you need at least 3 tables to properly do what you want.

  5. #5
    oscarmolivera is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Location
    maracaibo, Venezuela
    Posts
    4
    Maybe I didn't explain myself. Acctually all tables are "normalized", I've allready check that. what I'm showing here is the result of a query that has 3 related tables. But you right, maybe I shoud read a little more... I just thought that maybe it was so simple that it could be explained in a forum. I'm a novice on the access matter.
    Again, thanks you time.

  6. #6
    oscarmolivera is offline Novice
    Windows XP Access 2007
    Join Date
    Nov 2010
    Location
    maracaibo, Venezuela
    Posts
    4

    Found it

    Here's the answer if someone is looking for it to

    http://allenbrowne.com/AppInventory.html

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

Similar Threads

  1. Dynamic Web page
    By KevinH in forum Access
    Replies: 3
    Last Post: 01-03-2010, 06:56 PM
  2. Dynamic Query
    By pushpm in forum Queries
    Replies: 0
    Last Post: 04-22-2009, 12:58 PM
  3. Dynamic reporting
    By pushpm in forum Programming
    Replies: 0
    Last Post: 04-22-2009, 12:45 PM
  4. help with dynamic hyperlink to pdf
    By iresolver in forum Access
    Replies: 0
    Last Post: 12-24-2008, 01:21 PM
  5. Dynamic SQL Query
    By Squeaner in forum Queries
    Replies: 0
    Last Post: 09-25-2008, 02:37 PM

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