Results 1 to 3 of 3
  1. #1
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124

    add or subtract

    Hello, forum



    I would like to add or subtract the quantity the user's request.

    I decided to put a drop-down combo box for the user to select which option they want.

    The expression will be changing the on hold quantity that is tied with the item.
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    in a query:
    IIf(forms!myform!cboBox="-", (field1- field2), (field1+ field2))

    in a form:
    txtbox3 =IIf(cboBox="-", (txtBox1 - txtBox2), (txtBox1 + txtBox2))

  3. #3
    MdHaziq is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    Singapore
    Posts
    124

    How to apply IIf statement in my program?

    I am not sure on how to use IIF.
    Did some reading and that is all but I do not know how to apply in my program. I tried this exp. but it does not work.
    IIf([Forms]![frmHome]![cboaction]="Withdraw",[tblitem].[Qty]-[froms]![frmHome]![txtqty],[tblitem].[Qty]+[froms]![frmHome]![txtqty])
    Attached Files Attached Files

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

Similar Threads

  1. Subtract Groups
    By davetedwards in forum Reports
    Replies: 4
    Last Post: 12-30-2013, 10:56 AM
  2. Subtract Quantities Across Forms
    By SuperABen in forum Programming
    Replies: 5
    Last Post: 01-29-2013, 08:17 AM
  3. Subtract from Previous Row
    By lambo102 in forum Queries
    Replies: 1
    Last Post: 08-06-2011, 09:39 AM
  4. How to do subtract in Query
    By NoOoN in forum Queries
    Replies: 6
    Last Post: 04-07-2011, 01:15 PM
  5. Subtract from inventory
    By NISMOJim in forum Access
    Replies: 5
    Last Post: 01-30-2011, 01:09 PM

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