Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the IIf statement.

Status
Not open for further replies.

kjspear

Programmer
Feb 13, 2002
173
US
Hello everyone,

I'm trying to use a conditional statement using VBA.

Now I tried this recommended code in the control source of the textbox;

=IIf([Advisory],"Advisory Board","")

The only problem that I'm having is that I have more than two conditions. For example as stated above in the code,if advisory is true then print Advisory Board if not the print null. However, I also need to incorporate if Executive Board then print Executive Board only. The Executive Board takes preference over anything else regardless if the Advisory or any other checkbox is true. Only the Executive Board will be printed. If I don't need to use VBA then is there another way I can have more than two conditions something like the code above?

Any assistance will be appreciated.

Thank you,
KJ
 
Assuming you also have a Yes/No field called Executive

=IIf([Advisory],"Advisory Board",IIf([Executive],"Executive Board",""))

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top