IIF statement problem

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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]
 
Back
Top