IIf Function Example

This example evaluates the value of the contents of a text box and sets the accompanying caption to display the word "Large" if the amount is greater than 1000; otherwise, it displays the word "Small".

Label1.Caption = IIf(Text1.Text > 1000, "Large", "Small")