Formula displays Error rather than message

X

XP

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.
 
D

Duane Hookom

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.
 
J

Jan Kowalski

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.
 

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

Top