Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Nov 2001
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    return all records if no data is passed (2000)

    I am passing data from a form to a report to limit the data returned. I Have three fields "Event", "Day" and "Venue" If no venue is selected I want the formula to display everything for the Event and Day selected, and if a venue is selected then the records for the event, day and venue selected should be returned.

    The where statement in the report I have now is [forms]![frmReport-VolunteersNameTagsByEvent]![Venue] so I need it to be something like iif(IsNull([forms]![frmReport-VolunteersNameTagsByEvent]![Day] "*" else [forms]![frmReport-VolunteersNameTagsByEvent]![Day]) PLEASE HELP!

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: return all records if no data is passed (2000)

    I don't understand how you are doing this? Are you applying a filter to the report to limit the data, or are you using code to open the report and applying a where condition there?
    Wendell

  3. #3
    New Lounger
    Join Date
    Nov 2001
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: return all records if no data is passed (2000)

    Where condition in a report

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

    Re: return all records if no data is passed (2000)

    Try this as condition
    [Venue]=[Forms]![frmReport-VolunteersNameTagsByEvent]![Venue] Or [Forms]![frmReport-VolunteersNameTagsByEvent]![Venue] Is Null
    As Wendell remarked, it is not clear how you do this, in the criteria of a query, or in the WhereCondition argument of DoCmd.OpenReport. The exact method depends on that.

  5. #5
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: return all records if no data is passed (2000)

    Tyy this for the condition:

    [Venue]=[forms]![frmReport-VolunteersNameTagsByEvent]![Venue] & "*"

Posting Permissions

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