Results 1 to 2 of 2
  1. #1
    Evilferret is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    27

    Best approach for running calculation on report details?

    I have a report that needs to display the following information:



    (1) Original quantity required for purchase order
    (2) Quantity of goods shipped toward purchase order
    (3) Quantity of goods on shelf for this purchase order
    (4) Quantity of goods still to be produced

    (1) The original quantity required for the purchase order is a field in my database. Will be easy to display.

    (2), (3), and (4) are not fields in my database. I have a total quantity shipped and total quantity produced, but the shipments aren't associated with specific purchase orders. I'd like to loop through my records to build a temp table when the report is generated. The temp table will apply the parts that have been shipped to outstanding purchase orders, starting with the oldest purchase order.

    Where would I implement the code to generate the temp table? Should it be within the report itself, should it be an event that triggers when the button is pressed for report generation?

    Right now I'm looking at using two DAO.Recordsets (One containing parts shipped, one containing purchase orders) and looping through each to apply the parts shipped to the Purchase Orders. But this approach seems painfully inefficient.

    I would like to be able to do something along the lines of doing a Sum() of the quantities on all purchase orders grouped by Part Number, then doing a running tally of quantities as the Purchase Orders (Details) come up in the report, and suppressing any purchase orders where the running tally is less than the Sum() of quantity shipped... However I have no idea how to proceed with this or where the code would go.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Temp table code would be behind the button.

    Maybe subreports would produce what you want.

    How can a shipment not be traced to purchase order(s)?
    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.

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

Similar Threads

  1. Replies: 14
    Last Post: 01-31-2012, 09:53 AM
  2. Missing client details report
    By crxftw in forum Reports
    Replies: 3
    Last Post: 08-16-2011, 12:19 PM
  3. Multiple Details Sections of report
    By nkuebelbeck in forum Reports
    Replies: 1
    Last Post: 03-17-2010, 09:34 AM
  4. Replies: 0
    Last Post: 11-23-2009, 09:19 PM
  5. Replies: 26
    Last Post: 11-06-2009, 10:16 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