Results 1 to 2 of 2
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: IF staements (a2000)

    - IF is an Excel worksheet function, you can't use it in Access. Instead, you can use the VBA function IIf (Immediate If).
    - You don't need to check the condition twice, once is enough.
    - You must use parentheses ( ) around the arguments of the function.

    <code>=IIf([TotalActualWeight]>[TotalVolumeWeight],[TotalActualWeight],[TotalVolumeWeight])</code>

  2. #2
    2 Star Lounger
    Join Date
    Sep 2003
    Location
    London, Gtr London, United Kingdom
    Posts
    153
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IF statements (a2000)

    Good afternoon

    On a multi field form I have 2 fields that take their values from calculations on the form, I have a 3rd field that I would like populated with the highest value from these 2 other fields.

    field 1 TotalActualWeight
    field 2 TotalVolumeWeight
    field 3 TotalChargeableWeight

    in the control source property for TotalChargeableWeight I have put

    =IF[TotalActualWeight]>[TotalVolumeWeight],[TotalActualWeight],IF[TotalActualWeight]<[TotalVolumeWeight].[TotalVolumeWeight]

    But that gives me an #Error, could somebody point me in the right direction please

    Thanks


    Stephen

Posting Permissions

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