Results 1 to 7 of 7
  1. #1
    ezybusy is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2015
    Posts
    119

    How to use Allen Brown inventory functioon


    Hi,
    i am working on an inventory based project where Quantity On Hand is involved, and upon searching the internet, i found Allen Browne's approach to the matter.
    However, i have no idea as to how to use it or make it work.
    Can something help me, by describing the step-by-step process of using the code to display Quantity On Hand of products ?

    Thank you

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    I would think the first question is, do you really need it? I have a couple of fairly large apps where I just use the simpler method of summing the in's and out's for the quantity on hand (with date taken into account for "as of" reports). If you're not going to perform the "stock takes" he describes, the code is probably overkill.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    the code is documented explaining each step. I use the same principle of using the stocktake date as a starting point for your quantity on hand and summing from there. The only issue is having an accurate date and time since a stocktake taken at the start of the day may vary from one at the end because movements might have occurred during the day.

    for example you table might look like

    tblItems
    itemPK
    itemName

    tblStockMovement
    MovementPK
    ItemFK
    trantype (e.g. issued, received, stocktake)
    trandateT
    Qty


    simplistically your query might look something like

    Code:
    SELECT tblStockMovement.itemFK, sum(qty) as onHand
    from tblStockMovement INNER JOIN (SELECT itemFK, Max(trandateT) AS LastST FROM tblStockMovement WHERE trantype='StockTake' GROUP BY itemFK) AS ST ON tblStock.itemFK=ST.itemFK
    WHERE tblStock.trandateT>=ST.LastST
    GROUP BY  tblStockMovement.itemFK

    this bit is finding the last stocktake
    Code:
    (SELECT itemFK, Max(trandateT) AS LastST FROM tblStockMovement WHERE trantype='StockTake' GROUP BY itemFK)
    whilst this bit limits the records to those movements that are on or after the stocktake datetime
    Code:
    WHERE tblStock.trandateT>=ST.LastST

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,127
    You could look at the new Northwind 2.0 Developers Edition template which also uses Allen Browne's approach to managing inventory.
    This was covered in detail in the Access Europe User Group session on Wednesday and the video will be on YouTube in the next few days.
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  5. #5
    ezybusy is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2015
    Posts
    119
    Quote Originally Posted by isladogs View Post
    You could look at the new Northwind 2.0 Developers Edition template which also uses Allen Browne's approach to managing inventory.
    This was covered in detail in the Access Europe User Group session on Wednesday and the video will be on YouTube in the next few days.
    Alright, thank you very much.
    I just downloaded the Northwind 2.0 Developers Edition template, which i will look through closely.

  6. #6
    ezybusy is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2015
    Posts
    119
    Thank you very much CJ_London.

  7. #7
    ezybusy is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2015
    Posts
    119
    Well, i guess may not need it not this time. It's a relatively small project, for which i can think of other alternatives.
    However, i just want to do a clean work that will not require a lot of tweaking in case the database groes. So i think it's better to go through the hustle to do things right now.

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

Similar Threads

  1. Speed Up Allen's Brown's Concatenate Code
    By PSSMargaret in forum Access
    Replies: 6
    Last Post: 12-13-2019, 06:15 AM
  2. Using Allen Brown ConcatRelated() In Query
    By jo15765 in forum Queries
    Replies: 12
    Last Post: 01-16-2019, 11:22 PM
  3. Allen Brown's - FindAsUType - combo box order
    By Homegrownandy in forum Programming
    Replies: 6
    Last Post: 01-31-2018, 03:38 AM
  4. Allen Brownes Inventory code
    By bbrazeau in forum Programming
    Replies: 4
    Last Post: 09-11-2013, 09:56 AM
  5. Filter to a date range ala Allen Brown
    By kekawaka in forum Forms
    Replies: 2
    Last Post: 10-10-2011, 12:19 PM

Tags for this Thread

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