#Error in Iff statement

  • Thread starter Thread starter jhu4046062
  • Start date Start date
J

jhu4046062

I am receiving a #Error message when I change the PName field to the
following
=IIf(Len([PName]<=2),"-None Selected-",[PName]) in my report. The
PName is just a joining of Last and First Name with a comma and space
in between. I would like the report to say "-None Selected-" if No
Name was entered.
Any suggestions?
 
you have a closing bracket in the wrong place in the LEN function. Try this:

IIf(Len([PName]) <=2 ,"-None Selected-",[PName])

John


I am receiving a #Error message when I change the PName field to the
following
=IIf(Len([PName]<=2),"-None Selected-",[PName]) in my report. The
PName is just a joining of Last and First Name with a comma and space
in between. I would like the report to say "-None Selected-" if No
Name was entered.
Any suggestions?
 
I am receiving a #Error message when I change the PName field to the
following
=IIf(Len([PName]<=2),"-None Selected-",[PName]) in my report. The
PName is just a joining of Last and First Name with a comma and space
in between. I would like the report to say "-None Selected-" if No
Name was entered.
Any suggestions?

Your parenthesis is misplaced.
Also, I'm not sure if the PName field can be null, so....

=IIf IsNull([PName]) or len([PName]) <= 2, "-None Selected-",[PName])

You must also make sure the name of this control is not PName.
 
you have a closing bracket in the wrong place in the LEN function. Try this:

IIf(Len([PName]) <=2 ,"-None Selected-",[PName])

John

I am receiving a #Error message when I change the PName field to the
following
=IIf(Len([PName]<=2),"-None Selected-",[PName]) in my report. The
PName is just a joining of Last and First Name with a comma and space
in between. I would like the report to say "-None Selected-" if No
Name was entered.
Any suggestions?


That worked! THANKS!
 
Back
Top