Else If

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
 
J

John Crighton

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

I beleive this is what you need.

John C
 
W

Wayne Morgan

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

Anthony W

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
 
W

Wayne Morgan

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.
 

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