Results 1 to 3 of 3

Thread: IIF problem ^^

  1. #1
    Join Date
    Aug 2004

    Unanswered: IIF problem ^^

    I have a little problem with my query, which looks like this:

    SELECT *
    FROM EPATech
    WHERE (((EPATech.Abteilung)=Forms!AbtAusw!Abteilung1)) And IIf(Forms!AbtAusw!gummi="alle","","(((EPATech.Stat us)=Forms!AbtAusw!gummi))");

    As you can see, if gummi ( a combobox ) has the entry "alle", I don't need the additional condition "and (((EPATech.Status)=Forms!AbtAusw!gummi))".
    My solution was to use the IIF command, but somehow, it never branches into the (((EPATech.Status)=Forms!AbtAusw!gummi)) part, so I allways get every item in the table, even when gummi is not "alle".
    Can anybody help me out? I don't really have an idea of what to do.

    Thanks in advance!


  2. #2
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    WHERE ((EPATech.Abteilung=Forms!AbtAusw!Abteilung1) And (EPATech.Status= if(forms!AbAusw!gummi="alle", "*", forms!AbAusw!gummi)))
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Aug 2004
    Thanks for your answer, thats what I tried too, but instead of all entries, it returns none. -> "*" seems not to work properly.

    EDIT: I got it running now. instead of "*" I use EPATech.Status.

    complete query:
    SELECT *
    FROM EPATech
    WHERE ((EPATech.Abteilung=Forms!AbtAusw!Abteilung1) And (EPATech.Status=iif(forms!AbtAusw!gummi="alle",EPA Tech.Status,forms!AbtAusw!gummi)));
    Last edited by checkov; 08-11-04 at 01:50.

Posting Permissions

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