Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    Super Mario is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2018
    Posts
    12

    Dave,

    The last field in the query should have the following expression: QTyOnHandCalc: Nz([SumOfUnitsReceived])-Nz([SumOfUnitsSold])-Nz([SumOfUnitsShrinkage])-Nz([SumOfUnitsUsed])+Nz([SumOfCycleCountCorrection])

    Don't use spaces in the name Variable QTyOnHandCalc. The Nz() function will convert any NULL entry to 0 because if you add or subtract a NULL from a number the result will be NULL

    Click image for larger version. 

Name:	All_Parts_Inventory_Query_Design_View_Snipet.jpg 
Views:	8 
Size:	30.9 KB 
ID:	35385

    Click image for larger version. 

Name:	All_Parts_Inventory_Query_Datasheet_View.jpg 
Views:	8 
Size:	120.8 KB 
ID:	35386

    I still maintain that Product ID 1 belongs to Mfg Part No. 19800 and has four records (if you apply a filter for Product ID = 1).

    Click image for larger version. 

Name:	Inventory Transactions Filtered.jpg 
Views:	9 
Size:	57.0 KB 
ID:	35387

  2. #17
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    June7,

    I had missed that post, sorry for that.

    You posted "=Sum([UnitsReceived]) + Sum(Nz([CycleCountCorrection],0)) - Sum(Nz([UnitsSold],0)) - Sum(Nz([UnitsShrinkage],0)) - Sum(Nz([UnitsUsed],0))

    If you decide not to output the raw details, then set the Detail Section as not visible."

    I put that in the query and it works great.

    I did not know about the setting to set the detail section as not visible, thanks for letting me know about that, I will explore that further.

    I had tried the NZ prefix just before I left work and it was giving me the desired results but when I opened the report it was asking me about each field in the expression, and I just clicked thru the boxes and the report opened with the correct numbers.

    This has helped me out immensely.

    Thanks so much to all who replied.

    Could either of you help me with putting this into a Function for reuse or wouldn't that be the best way, I am thinking about the Allen Browne Example, although he uses 6 tables and I use only 3 to achieve the same data ( not saying that mine is a better solution by any means, in fact it probably isn't), I like how he uses a Function, I just could not seem to modify his code to get it to work.

    I have other forms that need the same info and will try to apply the same methodology to those.

    Dave

  3. #18
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2010 32bit
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    Super Mario,

    I am very confused, I can see that with the filter as you show, there does appear to be 2 different lines in the Inventory Transactions Table, however, if you open the Form "Inventory Transactions" PN 19800 is the first record and it only shows the opening balance of "0", It doesn't show the CycleCountCorrection qty of 35 because there is no PurchaseOrderID associated with that TransactionID of 2026.

    Could you please open the form "Inventory Transactions" and let me know what you see? on that form?

    Thanks

    Dave

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Can't figure out how to do this query
    By delorean004 in forum Queries
    Replies: 1
    Last Post: 12-22-2014, 04:33 AM
  2. Cant Figure This Out
    By tabbycat1234 in forum Forms
    Replies: 12
    Last Post: 07-27-2011, 02:19 AM
  3. can't figure out what i'm doing wrong
    By m0use in forum Queries
    Replies: 4
    Last Post: 06-16-2011, 09:18 AM
  4. Cannot Figure this query out
    By ryan1313 in forum Queries
    Replies: 6
    Last Post: 08-13-2010, 12:54 PM
  5. Can't Figure It Out!!
    By jdohio5 in forum Database Design
    Replies: 1
    Last Post: 05-04-2006, 06:49 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