Im not quite sure where you are putting this syntax, but try taking out the "=" signs, and add in a ":"
If([SumOfQuantity]>75 and <101) Then
([SumOfQuantity]*5)
ElseIf[SumOfQuantity])>100 Then
([SumOfQuantity])*10)
End If
Otherwise you may to to reference the actual control
If([SumOfQuantity]>75 and <101) Then
[ControlName] = ([SumOfQuantity]*5)
ElseIf[SumOfQuantity])>100 Then
[ControlName]=([SumOfQuantity])*10)
End If
You cannot test two values at the same time. You will need to do:
If([SumOfQuantity]>75) and ([SumOfQuantity]<101) Then
AVariable = ([SumOfQuantity]*5)
ElseIf ([SumOfQuantity]>100) Then
AVariable = ([SumOfQuantity]*10)
End If
I have moved the brackets to where they should be (compare to your original post). Also, you will need to assign the result to a variable of some sort (AVariable in this example).
Be aware that Access will not short-circuit the first IF statement - both tests will be calculated, even if the first (>75) is false.
This looks like you are working in the query design view. If that is the case then SQL does not recognize If-Then-Else so you need to use a nested IIf like this:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.