• Query iif (2000)

    Author
    Topic
    #456113

    Hi, I have a query that restricts by a date completed on a user form. On my form I also have a tick box defaulted to no, with the idea that if it is no then the
    query searches only on the given date on the form, if yes then it searches for the date and those beyond. If nothing is sleected within the fdate on the form then the query should show all dates. This is the code I have put onto my citeria but it isn’t playing, guidance is appreciated. The tick box is “tckP”, date is “prefdate” .

    IIf([frmReports].[tckP]=No,[tblName].[prefDate] Or Is Null,<=[tblName].[preference] Or Is Null). The field line shows [forms]![frmReports]![Pref].

    Thanks Darren.

    Viewing 0 reply threads
    Author
    Replies
    • #1138234

      You can’t do it like that, because you can’t use criteria such as Is Null within an IIf function.

      I’m not sure I understand your description, but I think you’ll have to use two lines in the Criteria – see screenshot below.

    Viewing 0 reply threads
    Reply To: Query iif (2000)

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

    Your information: