How do I write a statement to return a name when there are 3 poss.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In an unbound text box on a report I wrote the statement
=IIF([Trip]=yes) OR ([Pres]=yes) OR ([Yrs]=>9),([Last Name]&" ,"&[First Name])
I expectd this to return a list of members who met any 1 of the arguements.
Instead I get all sorts of error messages.
Trip, Pres, Yrs, Last Name and First Name are fields in a table.
 
In an unbound text box on a report I wrote the statement
=IIF([Trip]=yes) OR ([Pres]=yes) OR ([Yrs]=>9),([Last Name]&" ,"&[First Name])
I expectd this to return a list of members who met any 1 of the arguements.
Instead I get all sorts of error messages.
Trip, Pres, Yrs, Last Name and First Name are fields in a table.

It would be nice to know what the error messages are?
I'll guess.

1) Make sure the name of his control is not the same as the name of
any field used in it's control source expression.

2) Make sure the names of each field is properly spelled, and exists
in the report's record source.

3) You don't have the parenthesis properly placed. All you need is one
after the IIf and one at the end.

4) What is the datatype of [Trip] and [Pres] ?
A Check Box Yes/No field?
Try....
=IIF([Trip]=-1 OR [Pres]=-1 OR [Yrs]>=9,[Last Name] &" ," & [First
Name],"")

Notice I've changed the =>9 to >=9, as well as the number value of the
2 fields and added a false value "" to the expression.

If [Trip] and [Pres] are Text datatypes, then:

=IIF([Trip]="yes") OR ([Pres]="yes") OR ([Yrs]>=9),[Last Name] & " ,"
& [First Name],"")
 
Back
Top