Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query iif (2000)

    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.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Query iif (2000)

    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.
    Attached Images Attached Images
    • File Type: png x.png (3.8 KB, 0 views)

  3. #3
    4 Star Lounger
    Join Date
    May 2003
    Location
    Manchester, Gtr Manchester, England
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query iif (2000)

    Hans, this nails it. tThank you.

    Darren.

Posting Permissions

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