Consulting

Results 1 to 2 of 2

Thread: Solved: Conditional Criteria in query

  1. #1
    VBAX Regular AJS's Avatar
    Joined
    Sep 2004
    Location
    Melbourne
    Posts
    61
    Location

    Solved: Conditional Criteria in query

    Hi,

    I have been trying to set up a query such that it looks up the selection in an unbound combo box on a form otherwise based on the query. It is supposed to work like this: if a certain value is selected in the combo box, then one field is filtered, if another value is selected then a different field would be filtered in a different way etc.

    To do this, I have set up a series of iif expressions in the query such as:

    IIf([Forms]![Table1]![Combo10]="A","Name1","")

    under a text field, and

    IIf([Forms]![Table1]![Combo10]="B",Yes,"")

    under a Yes/No field etc.

    Basically, I'm trying to set it up such that if the specified value is not present, then the field is unfiltered. When I try to reopen the form, I get an error message saying that "the expession is typed incorrectly, or it is too complex to be evaluated". Have I got the syntax right, or should I be using a different approach?

  2. #2
    VBAX Regular AJS's Avatar
    Joined
    Sep 2004
    Location
    Melbourne
    Posts
    61
    Location
    Got it working, via:

    IIf([Forms]![Table1]![Combo1]="A","Name1",[Name])

    etc...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •