IF conditions

awake2424

Registered User.
Local time
Today, 09:16
Joined
Oct 31, 2007
Messages
479
Is it possible on a Access 2003 form to have an IF statement with multiple conditions?

=IIF ([Score]<="3.0","Excellent"), or IIF ([Score]>="3.1"<".5.0","Good"), or IIF ([Score]>"5.1","Bad")

Thanks.
 
if its behind a form, use an IF statement. if its in a control source of a control, use the IIF() statement. if you don't know the syntax, look it up. its in the help menu.
 
Try;

IIf([Score]<="3.0","Excellent",IIf([Score] Between "3.1" And "5.0","Good",IIf([Score]>"5.1","Bad")))
 
Is it possible on a Access 2003 form to have an IF statement with multiple conditions?

=IIF ([Score]<="3.0","Excellent"), or IIF ([Score]>="3.1"<".5.0","Good"), or IIF ([Score]>"5.1","Bad")

Thanks.

It really depends where you are performing the test. You have two basic choices (VBA and SQL). Since you are using IIf() in your example, I will deal with the SQL answer. If you want/need the VBA one, that can be address in a later post.

Looking up the DEFINITION of an IIf() statement, you find the following:

IIf( { Condition to test }, { Value or Expression if Condition=True }, { Value or Expression if Condition=False } )

The "Value or Expression if Condition=True" can be another IIf() statement, and there are multiple levels allowed. Since this has been discussed in these Forums many times, I invite you to search these Forums for additional details.

Note: As usual, Work interrupted me in my attempt to respond, and others replied with similar responses before I did. All three of us agree as to the resolution to your issue, so I leave it to you to find the best way to make it work for your project.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom