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!!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top