Posted on 2011-04-29
Last Modified: 2012-05-11
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,"")
Question by:pdvsa
    LVL 9

    Accepted Solution

    Use something like

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

    LVL 47

    Assisted Solution

    by:Dale Fye (Access MVP)
    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, "")


    Author Closing Comment

    thank you.  the cboFeeType is a the name of FeeType that is a combo box.  it is the control name.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    In the previous article, Using a Critera Form to Filter Records (, the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
    Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now