I need help with a simple IIF statement. I have two fields,
Code:
and [RATE]. The I would like is if [COLOR=royalblue][B]Code=8[/B][/COLOR] then the [COLOR=seagreen][B]Rate = 67.50[/B][/COLOR].
Can someone help?[/QUOTE]
If you look up the format for the IIf() Statement, you will find that it is as follows:
IIf([B][COLOR=royalblue]Condition to Test[/COLOR][/B], [COLOR=seagreen][B]Value if TRUE[/B][/COLOR], [COLOR=red][B]Value if FALSE[/B][/COLOR])
Place your parameters in the appropriate places, Select a value for FALSE, and you should get what you want.
have multiple options?[/QUOTE]
You can use a compound IIF() statement or perhaps a SELECT CASE Statement to test more than one condition. Look up these statments and get back with any questions.
has four possibilities:
1 = 67.50
2 = 50.00
8 = 51.75
10 = 36.00
When 1,2,8 or 10 is placed the Code filed I am trying to populate the rate field with the corresponding number, i.e, 67.50, 50.00, 51.75 or 36.00
Thanks for your consideration.
I agree with Simon. While There are ways to create an IIf() Statement or a SELECT CASE Block that will do what you want, a table has the advantage of leaving room for growth or modification without changing the program in any way.