Results 1 to 12 of 12
  1. #1
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130

    DB Design Based on Report Generation

    Hello,



    I am developing a db that will show on hand quantity of raw materials. From this data, I would like to show which parts need to be reordered. What should happen is the user enters when a part comes in and updates the db daily on how much was used. My very broad question is what is the ideal way to store this data so it can be retieved for a report or alert. I was considering having an 'Adjustment Table' which would show every adjustment made (order requested, order received, and depletion quantity) for every single part. From here, I was planning on filtering the data based on part number, making calculations based on type of adjustment, then running this for each part. Once this is complete (on a normal basis), it would send alerts (via email or msgbox) that notifies the user when they are getting to the point of reordering. I could use all the feedback I can get. Thanks!

    P.S. I have posted on here about this db recently and you may think this is a repost, but the main objective has altered since my last question.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    That all sounds reasonable. When you encounter specific issue in development, post a question.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    From here, I was planning on filtering the data based on part number, making calculations based on type of adjustment, then running this for each part. Once this is complete (on a normal basis), it would send alerts (via email or msgbox) that notifies the user when they are getting to the point of reordering
    This clearly wouldn't have to be done one part at a time, though. Once you have a set of queries and code that would do it for one part, you could do it for all parts in one swell foop.

  4. #4
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    Dal, how would I go about doing this then? I have the database pretty well built and some data inside, but now I am focused on creating a report that is useable.
    What I need it it do is essentially show the on-hand quantity (tblReceived - tblConsumed) for a specific part. Any ideas how to do this? I started another thread where I am trying to use a function within a module, but I am not sure how to pass the value correctly...

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Do aggregate query for each table that groups on the part ID. Join those two queries to the Parts table. Build report based on that third query.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    I currently have a query that joins all the consumption, received and parts tables, then i build the report off of this, but the part that is tricky is
    a) how do i show the records for all the consumption AND received entries, even if one part may only have one or the other. Right now it is only showing the parts that have a record for BOTH received and consumed.
    b) how do I get rid of all these records and just show the sums?

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    See my previous post. That's what I was describing.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    Ok, thanks June7. I will try this, and let you know if I need any additional guidance.

  9. #9
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    So I am still running into the same problem... the query that was built is still only showing records of part numbers that have a consumed AND received transaction for the same PartID. I need it to show all PartID's, which will be ones with only received OR and consumed. My query looks like:
    Code:
    SELECT tblPartInfo.PartNumber, tblSupplier.SupplierName, ConsumedSumQuery.SumOfConsumedQuantity, ReceivedSumQuery.SumOfReceivedQuantity
    FROM tblSupplier INNER JOIN ((tblPartInfo INNER JOIN ConsumedSumQuery ON tblPartInfo.PartID = ConsumedSumQuery.PartID) INNER JOIN ReceivedSumQuery ON tblPartInfo.PartID = ReceivedSumQuery.PartID) ON tblSupplier.SupplierID = tblPartInfo.SupplierID;
    If you need a screenshot, my db uploaded or any other SQL, please let me know.

  10. #10
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Try something like this -
    Code:
    SELECT 
       tP.PartNumber, 
       NZ(tS.SupplierName,""), 
       NZ(QC.SumOfConsumedQuantity,0), 
       NZ(QR.SumOfReceivedQuantity,0)
    FROM 
       ( ( (tblPartInfo AS tP 
            LEFT JOIN 
            ConsumedSumQuery AS QC 
            ON tP.PartID = QC.PartID) 
          LEFT JOIN 
          ReceivedSumQuery AS QR 
          ON tP.PartID = QR.PartID) 
        LEFT JOIN 
        tblSupplier AS tS
        ON tS.SupplierID = tP.SupplierID);

  11. #11
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    Thanks Dal! I just realized that I needed to use Left Joins and was learning how to do this.

  12. #12
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Heh, heh. No charge, man.

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

Similar Threads

  1. Error on generation of report
    By TOMMY.MYERS668 in forum Reports
    Replies: 1
    Last Post: 03-02-2013, 11:06 AM
  2. Replies: 3
    Last Post: 02-05-2013, 06:34 PM
  3. Replies: 4
    Last Post: 11-15-2012, 09:33 AM
  4. Report Generation from with a Form
    By amangupts in forum Reports
    Replies: 29
    Last Post: 07-22-2011, 08:40 AM
  5. Report Generation
    By Lorlai in forum Reports
    Replies: 5
    Last Post: 07-01-2011, 11:13 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