IIF STATEMENT

Experts,  the below is not correct.  when I tab out I get an error msg box.  I am not sure if I can use like and IIF.  If so, please let me know where the below is incorrect.  
cboFeetype is a combo with a row source qry.

=iif(([cboFeetype]).column(1) like "*amend*",250,"")
pdvsaProject financeAsked:
Who is Participating?
 
sshah254Connect With a Mentor Commented:
Use something like

IIf(Instr(1, mydataset, "amend") > 0, 250, "")

Ss
0
 
Dale FyeConnect With a Mentor Commented:
Where are you trying to use this?

=iif(([cboFeetype]).column(1) like "*amend*",250,"")

Is it in the control source of an unbound textbox on a form?  Is cboFeeType a field name, or a control name, I've rarely encountered field names that use control naming conventions?  If it is a control, then the syntax would look something like:

=iif(me.cboFeeType.column(1) Like "*amend*", 250, "")

or you could use INSTR as mentioned by sshah254

=iif(instr(me.cboFeeType.column(1), "amend") <> 0, 250, "")

0
 
pdvsaProject financeAuthor Commented:
thank you.  the cboFeeType is a the name of FeeType that is a combo box.  it is the control name.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.