Can't get Text field IIf function to work in report

  • Thread starter Thread starter sabrown
  • Start date Start date
S

sabrown

Have a simple text field being pulled into a report that I wnat to test
for particular string and if found substitute a new string on the
report. Have tried all kinds of IIf statements using =, like etc. all
to no avail. Tried...

=IIf([CURR_MODEL] In ("ARPN","ARPG"),"ARP",NA)
=IIf([CURR_MODEL]="ARP?","ARP"...
=IIf([CURR_MODEL] like "ARP?","ARP"...

HELP!
 
Have a simple text field being pulled into a report that I wnat to test
for particular string and if found substitute a new string on the
report. Have tried all kinds of IIf statements using =, like etc. all
to no avail. Tried...

=IIf([CURR_MODEL] In ("ARPN","ARPG"),"ARP",NA)
=IIf([CURR_MODEL]="ARP?","ARP"...
=IIf([CURR_MODEL] like "ARP?","ARP"...

HELP!



=IIF([Curr_Model]="ARPN" or [Curr_Model]="ARPG",ARP","NA")
or..
=IIf(Instr([Curr_Model],"ARP")=1,"ARP","NA")
or..
=IIf([CURR_MODEL] like "ARP?","ARP","NA")
or..
=IIf([CURR_MODEL] In ("ARPN","ARPG"),"ARP","NA")
all work for me.

I notice you didn't have quotes around the IIf false value NA in your
code
=IIf([CURR_MODEL] In ("ARPN","ARPG"),"ARP",NA)
 
I had the quotes in the actual code. None of these will work. I get
#Error as result with any expression I try against the field.

Thanks, Scott
 
Turns out I can get it to work by creating a hidden Bound control to
[CURR_MODEL] then start fresh with the calc in an unbound control.
 
I had the quotes in the actual code. None of these will work. I get
#Error as result with any expression I try against the field.

Thanks, Scott

Make sure that the name of the control is not the same as the name of
one of the fields used within the expression.
Had you indicated that you were getting #error (instead of writing "
all to no avail. Tried..." I would have pointed that out to you in my
first reply!!!!
 
Back
Top