Else If

  • Thread starter Thread starter Anthony W
  • Start date Start date
A

Anthony W

I am currently using a form and on the form I have a field
which is the 'type of learning programme' and another
which is a text box.

I want to be able to say if 'TypeLP' is '01' then 'MA' or
if 'TypeLP' is 02 then 'FMA' and so on.

Please can you tell me what code I would need and where to
put it please.

Thanks in Advance

Anthony
 
Take a look at the immediate IF function (IIF).

I beleive this is what you need.

John C
 
John is correct, IIF is what you need. For the "and so on" part, you'll need to nest them.

Example:
=IIf([TypeLP]="01", "MA, IIf([TypeLP]="02", "FMA", "ThirdType"))

You would continue to put a new IIF in the False part until you have gone through all but
one of the possible TypeLPs, the last one doesn't need its own IIF, it just becomes the
answer when all others are False.
 
Thanks for that.

Where would i put the code?

-----Original Message-----
John is correct, IIF is what you need. For the "and so
on" part, you'll need to nest them.
Example:
=IIf([TypeLP]="01", "MA, IIf([TypeLP] ="02", "FMA", "ThirdType"))

You would continue to put a new IIF in the False part
until you have gone through all but
one of the possible TypeLPs, the last one doesn't need
its own IIF, it just becomes the
 
In the Control Source for the textbox. This will make the textbox a calculated control
instead of one that is bound to a field in a table.
 
Back
Top