• Multiple Select query (97/SR2)

    Author
    Topic
    #365500

    Sorry about the length of this but pls bear with me.

    I am having trouble constructing the criteria for a query. The criteria is
    based on a combo box on a main menu. The options in the combo are:
    ,Marketing,Admin,Sales,HR,Accounts,Maintenance. If I select , I
    want all records returned, if I select Admin, I want to see Admin records
    only, the same for Accounts. However, if I select Marketing, I want to see
    Marketing and Sales records, and if I select HR, I want to see HR and
    Maintenance records.

    I feel I can’t get past first base on this because if I try this:

    IN(“Marketing”,”Sales”)

    it works.

    If I try

    Iif(Forms![frmMenuForm]![Dept]=”Marketing”,In(“Marketing”,”Sales”),”blah
    blah blah”)

    I get an error msg: the query is too complex etc

    Can someone help me with a neat criteria for all that I want to achieve?

    Thanks in advance.

    Viewing 0 reply threads
    Author
    Replies
    • #564331

      In your query type in the criteria for Dept on consecutive rows like this:
      “Admin”
      “Accounts”
      In(“Marketing”,”Sales”)
      In(“HR”,”Maintenance”)
      Like “*”

      In a new column of your query type:
      Combo:Forms![frmMenuForm]![Dept]

      In Combo’s criteria type (consecutive rows):
      “Admin”
      “Accounts”
      “Marketing”
      “HR”
      “”

      That’s all. Hope you find this helpfull.

      • #564573

        Brilliant! It works perfectly.

        Thank you.

        Is there any one reference book which lists ‘tricks’ like these?

        Nick

    Viewing 0 reply threads
    Reply To: Multiple Select query (97/SR2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: