IIF statement in a control

G

Guest

I have a text box on a form that I want to display A Team or B Team or C Team
if textbox A is greater than B and C, if textbox B is greater than A and C
e.t.c.
The textbox actually displays A Team or B Team or C Team, but what I
actually want is for the textbox to display A Team only if its greater than
textbox B and greater than textbox C. This is the code on the control form:

=IIf([ATotal]>[BTotal] & "" & [CTotal],"A Team",IIf([BTotal]>[ATotal] & "" &
[CTotal],"B Team",IIf([CTotal]>[ATotal] & "" & [BTotal],"C Team")))

Any help on this will be greatly appreciated.

Thanks
Newby
 
S

Steve

Take a look at the Choose function in the Help file. That is probably what
you want.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
G

Guest

Thank you Alex. You're right on the money.
--
TO


Alex Dybenko said:
Hi,

try:
=IIf([ATotal]>[BTotal] AND [ATotal]>[CTotal],"A Team",IIf([BTotal]>[ATotal]
AND [BTotal]>[CTotal],"B Team","C Team"))


--
Best regards,
___________
Alex Dybenko (MVP)
http://alexdyb.blogspot.com
http://www.PointLtd.com



newby said:
I have a text box on a form that I want to display A Team or B Team or C
Team
if textbox A is greater than B and C, if textbox B is greater than A and C
e.t.c.
The textbox actually displays A Team or B Team or C Team, but what I
actually want is for the textbox to display A Team only if its greater
than
textbox B and greater than textbox C. This is the code on the control
form:

=IIf([ATotal]>[BTotal] & "" & [CTotal],"A Team",IIf([BTotal]>[ATotal] & ""
&
[CTotal],"B Team",IIf([CTotal]>[ATotal] & "" & [BTotal],"C Team")))

Any help on this will be greatly appreciated.

Thanks
Newby
 

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