Formula displays Error rather than message

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

Guest

I have the following formula in the Control Source of a report; the problem
is rather than "No Changes", it displays Error when this evaluates to true:

=IIf([RCD_NW]="Y","New Position",IIf([RCD_NW]="N","Change to Existing","No
Changes"))

Can some one please help me out with this? How can I get the third message
to display when RCD_NW is neither "Y" nor "N"?

Thanks in advance.
 
Does the control always display Error? If so, you may need to change the name
of the control to something like txtRCD_NW.

You might also look at the Switch() function which is easier to maintain
when you start nesting IIf()s. Personally, I would either create a lookup
table for the values and their titles or create a small user-defined function
to return the title based on the value of RCD_NW.
 
U¿ytkownik "Duane Hookom said:
Does the control always display Error? If so, you may need to change the
name
of the control to something like txtRCD_NW.

You might also look at the Switch() function which is easier to maintain
when you start nesting IIf()s. Personally, I would either create a lookup
table for the values and their titles or create a small user-defined
function
to return the title based on the value of RCD_NW.

--
Duane Hookom
Microsoft Access MVP


XP said:
I have the following formula in the Control Source of a report; the
problem
is rather than "No Changes", it displays Error when this evaluates to
true:

=IIf([RCD_NW]="Y","New Position",IIf([RCD_NW]="N","Change to
Existing","No
Changes"))

Can some one please help me out with this? How can I get the third
message
to display when RCD_NW is neither "Y" nor "N"?

Thanks in advance.
 
Back
Top