IIF statement problem

G

Guest

i have a combo box field called type of employed whereby the user can select
either
-Company
- Self Employed(external)
- LSBU employed (Internal)

I have a course codes field, whereby i want to only allow a user to input
data into this field if they are LSBU employed(internal).
I have tried creating an Iif expression which i put in the control source of
my course codes text box

=IIf([Type of employment]="Company" Or "Self employed (External)","Not
Applicable","Please Press Browse Course")

which states that if the type of employment field is company or self
employed, it will insert 'Not Applicable'. If LSBU employed is selected from
the type of employment field, then it will insert the string "Please Press
Browse Course" but this statement isnt working. its just inserting Not
applicable in the fields despite the values i select from [type of
employment] field.

I would normally just lock the field in the properties section of that text
box, but i dont know how to do this if it is dependant on over values in the
form. Any methods?

Thanks
 
J

John Vinson

i have a combo box field called type of employed whereby the user can select
either
-Company
- Self Employed(external)
- LSBU employed (Internal)

I have a course codes field, whereby i want to only allow a user to input
data into this field if they are LSBU employed(internal).
I have tried creating an Iif expression which i put in the control source of
my course codes text box

=IIf([Type of employment]="Company" Or "Self employed (External)","Not
Applicable","Please Press Browse Course")

which states that if the type of employment field is company or self
employed, it will insert 'Not Applicable'.

Umm... no, it doesn't state that. That's a reasonable English language
interpretation, but the Boolean logical operator OR and the
English-language conjunction OR are NOT THE SAME!

Try

=IIf([Type of employment]="Company" Or [Type of employment]="Self
employed (External)","Not Applicable","Please Press Browse Course")

This assumes that the Bound Column of the combo box actually contains
these text strings rather than some numeric lookup ID.

John W. Vinson[MVP]
 

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

Similar Threads

IIf expression prob 3
Conditional fields 4
terminating macros 1
IF, AND & OR 3
problem with delays on form 5
Multiple What IIf Function In Query 6
Years of Employment 2
Nested IIF Statements 3

Top