Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Building Calculation (2000)

    Hi,

    We have two fields with possible fees in. One is a set fee and the other is a percentage. I have a field on the form called SellingFee which is the percentage and FixedFee which is the monetary value. There is a third field called Income which is to display the income used fromeach record. I want to have it so: -

    Income = [SellingFee%] * [Price] or if sellingfee% is null then Income = FixedFee

    How can I convert this into vba/access?
    Best Regards,

    Luke

  2. #2
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Building Calculation (2000)

    Thank you for explaining this to me, I understand where I was going wrong! As ever a great asset to the forum!
    Best Regards,

    Luke

  3. #3
    4 Star Lounger
    Join Date
    Mar 2005
    Location
    Leicestershire, United Kingdom
    Posts
    506
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Building Calculation (2000)

    All I get in the text box, is #Name? after entering that Iff statment into the control source
    Best Regards,

    Luke

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Building Calculation (2000)

    Set the control source of the Income text box to
    <code>
    =IIf(IsNull([SellingFee%]),[FixedFee],[SellingFee%]*[Price])
    </code>

    The IIf function (Immediate If) can be used in expessions for conditional calculations. Its syntax is

    IIf(Condition, Result_If_True, Result_If_False)

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Building Calculation (2000)

    It should be <code><big>IIf</big></code>, not <code><big>Iff</big></code>.

    Added: I had a typo in the expression too - I had <code>SelllingFee</code> instead of <code>SellingFee</code>. Now corrected. Sorry about that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •