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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if statement 1

Status
Not open for further replies.

nike2000

Technical User
Apr 1, 2003
61
GB
Hi,
I am writing a report that one Control Box requires an If Statement.

The following four fields have a value of Yes or No.

Migrate
Middle Office Check
Trader Check Check
Vanilla Trade Check

I would like to have an If statment that would return the value of 'Yes' if all the above fields have 'Yes' displayed in them.
If 'No' appears in any I would like the result to be 'No'
Only all of them must be 'Yes' to display 'Yes'.

Your help is appreciated.
Thanks for taking a look.
Nike
 
in the control source for the text box you want to have "Yes" or "No" to appear in, you need this:

(I am assuming that you have "Yes" or "No" in the fields:

Code:
=IIF([Migrate]="Yes" AND [Middle Office Check]="Yes" AND [Trader Check Check]="Yes" AND [Vanilla Trade Check]="Yes","Yes","No")

Alternatively, if the fields are check boxes, where <tick> = &quot;Yes&quot; and <no_tick> = &quot;No&quot;, then this will work:

Code:
=IIF([Migrate]=True AND [Middle Office Check]=True AND [Trader Check Check]=True AND [Vanilla Trade Check]=True,&quot;Yes&quot;,&quot;No&quot;)

Hope one of these helps :)
Aubs
 
It worked perfectly.
Thank you for your help.
Nike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top