Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF Conditional Statement

Status
Not open for further replies.

Quan9r

Technical User
May 18, 2000
36
US
I maybe attacking this problem incorrectly...but this is what I'm having trouble doing.

I have a continuous form to input training.
Within the form I have a check box - that designates if that selected person requires quarterly training.

What I would like to occur is - if the box is checked then the 1,2,3,4Quarter training fields would be visible.
I have tried to place the following statement:
IIf ([Member] = False), Me![1Qtr Training].Visible = False
in the form detail section (mouse move) and the Form (On Open) but it doesn't work.

Any suggestions?


 
ZmrAbdulla, Thanks for the tips - it kinda worked....it either kept all of the date fields or made them invisible. I would like each row to be specific to each member - where on row may have all 4 quarter fields and one row many not have any based upon the checkbox.

Thanks for the help though...I will keep trying different ideas
 
I'm not sure you'll be able to correctly update your tables correctly if you use this method, but it will display the data the way you want it to

instead of using the field name for the controlsource use an IIF statement which displays the value in the Field if the Checkbox = True and nothing if it is False.

=IIf([Member]=-1,[1QtrTraining],"")

BTW.. I tried using field names of "1Qtr Training" or "2Qtr Training" (with a space in it) and the form would only show an error in the textbox, even if I used an underline to connect the two strings 1Qtr_Training in the IIF statement, so I had to rename the fields without a space or add the underline to the field name before it would display correctly in the form. You may want to consider using field names without spaces in them.

PaulF
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top