Results 1 to 4 of 4
  1. #1
    Eldridge is offline Novice
    Windows XP Access 2010 64bit
    Join Date
    Feb 2017
    Posts
    1

    Visual Basic Code, Trying to get the Balance for a total Quantity on Hand after transactions

    We are attempting to use this code to no avail. It seems we have gone over it and over it,,, just cant figure out why it does not function.. any help would be greatly appreciated.

    Bal: IIf([InventoryTransactions_tbl]![QtyIn]>0,Sum([InventoryTransactions_tbl]![QtyIn]+[InventoryTransactions_tbl]![QtyonHandl]=[InventoryTransactions_tbl]![Bal])
    IIf([InventoryTransactions_tbl]![QtyOut]>0,Sum([InventoryTransactions_tbl]![QtyOut]-[InventoryTransactions_tbl]![QtyonHand]=[InventoryTransactions_tbl]![Bal]))




    THANKS.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    This should not be done with IIFs. Use an update query to reduce the inventory to the point of zero.

  3. #3
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    First part has 2 ( but only 1 )
    Second has 2 ( and 2 )

    ??


    Sent from my iPhone using Tapatalk

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    Eldridge,

    See this article by Allen Browne on QuantityOnHand
    Also, if you search this forum for Quantity on Hand, I think you will find some posts that may be helpful to you.
    Good luck.

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

Similar Threads

  1. Visual Basic Code Disappears
    By Anton in forum Programming
    Replies: 1
    Last Post: 11-02-2012, 06:16 PM
  2. Visual Basic Code for If Else
    By Baldeagle in forum Programming
    Replies: 1
    Last Post: 09-14-2012, 08:46 AM
  3. calculating On Hand Quantity
    By hbm001 in forum Queries
    Replies: 18
    Last Post: 04-24-2012, 09:42 AM
  4. Replies: 1
    Last Post: 06-29-2011, 07:22 AM
  5. Can't see visual basic code
    By Michele Keck in forum Forms
    Replies: 5
    Last Post: 09-29-2010, 11:31 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