Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

IIF statement problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Connie - 05 Apr 2005 02:19 GMT
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
John Vinson - 05 Apr 2005 06:53 GMT
>i have a combo box field called type of employed whereby the user can select
>either
[quoted text clipped - 12 lines]
>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]    
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.