iif() function in MS-Access

  • Thread starter Thread starter Aarti Saxena
  • Start date Start date
A

Aarti Saxena

Hi,

Can someone show me example code of writing several
conditions for an if statement. I want to make sure that
in the "else" part of an iif statement I can go to another
iif statement and add as many as iif statements.

If someone can help me, it will be a great help.
Thanks a lot.
Aarti
 
Aarti Saxena said:
Hi,

Can someone show me example code of writing several
conditions for an if statement. I want to make sure that
in the "else" part of an iif statement I can go to another
iif statement and add as many as iif statements.

If someone can help me, it will be a great help.
Thanks a lot.
Aarti


DigitWord: IIf([fld]=5,
"Five",IIf([fld]=4,"Four",IIf([fld]=3,"Three","Other")))

I think there might be a limit to how many IIf() can be nested. Generally
if I have to go more than three deep I write a custom VBA function instead.
You might also want to look at Choose() and Switch(). In some cases they
would be easier to use than a nested IIf().
 
Thanks a lot. working good
-----Original Message-----
Aarti Saxena said:
Hi,

Can someone show me example code of writing several
conditions for an if statement. I want to make sure that
in the "else" part of an iif statement I can go to another
iif statement and add as many as iif statements.

If someone can help me, it will be a great help.
Thanks a lot.
Aarti


DigitWord: IIf([fld]=5,
"Five",IIf([fld]=4,"Four",IIf([fld]=3,"Three","Other")))

I think there might be a limit to how many IIf() can be nested. Generally
if I have to go more than three deep I write a custom VBA function instead.
You might also want to look at Choose() and Switch(). In some cases they
would be easier to use than a nested IIf().


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


.
 
Back
Top