Results 1 to 4 of 4

Thread: IIF Syntax

  1. #1
    Join Date
    Sep 2003
    Location
    MN US
    Posts
    313

    Unanswered: IIF Syntax

    Hello,

    I'm trying to use a combobox as a filter for a report. The query is like this:

    field = FlavorID (autonumber)

    criteria:

    IIF([Forms]![frmReportChooser]![FlavorBox] Is Null, Like "*", [Forms]![frmReportChooser]![FlavorBox])

    If the user does not make a selection, I need to display all records. The "Like "*"" yields no records.

    Not sure what I'm doing wrong. Any insight is much appreciated.

    CP

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    * is a string comparison.

    STR(Field) LIKE nz(forms!frmReportChooser!FlavorBox, "*")

  3. #3
    Join Date
    Sep 2003
    Location
    MN US
    Posts
    313
    Originally posted by Teddy
    * is a string comparison.

    STR(Field) LIKE nz(forms!frmReportChooser!FlavorBox, "*")
    Thanks Teddy.
    That did it.

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    np

Posting Permissions

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