Page 1 of 3 123 LastLast
Results 1 to 15 of 33
  1. #1
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Criteria Choice (2003)

    I have created a query which I want to use in a report, and have put [Date ] and [User ] in the criteria. The problem is that if I don't enter data in both, I get a blank result. How can I just enter data into 1 of the criteria?

    Rob.

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

    Re: Criteria Choice (2003)

    Instead of putting [Date ] and [User ] in the criteria line, do it as follows:

    In the first empty column of the query grid, enter [Date ] in the Field line, and [NameOfDateField] Or Is Null in the Criteria line, substituting the correct field name.
    In the next empty column of the query grid, enter [User ] in the Field line, and [NameOfUserField] Or Is Null in the Criteria line, substituting the correct field name.

  3. #3
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Criteria Choice (2003)

    Thanks once again Hans. Just got my PC at work back in working order, that's why I haven't replied to other post's you've answered. Still got a problem with Charts (Post 452512), but I'll posty my reply to that post.

  4. #4
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Criteria Choice (2003)

    Yes that did work, but now I've hit another problem. Some of the User fields have 2 users like "Dave, Phil". How can I find this result if the person running the report just types in one name in the prompt?

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

    Re: Criteria Choice (2003)

    You could use Like "*" & [NameOfUserField] & "*" Or Is Null

  6. #6
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Criteria Choice (2003)

    No, it doesn't seem to like that

  7. #7
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Criteria Choice (2003)

    It doesn't find anything

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

    Re: Criteria Choice (2003)

    Sorry, my reply wasn't correct. Remove the new columns, and enter the following in the Criteria line under the username field:

    Like "*" & [User ] & "*" Or [User ] Is Null

    and under the date field:

    [Date ] Or [Date ] Is Null

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

    Re: Criteria Choice (2003)

    My apologies, I corrected my reply.

  10. #10
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Criteria Choice (2003)

    Still not working. When I entered 'Date' and 'User' into the fields, they changed to Expr1:[Date] and Expr2:[User], is that right. I've done everything else you suggested.

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

    Re: Criteria Choice (2003)

    My original suggestion (in <post#=455633>post 455633</post#>) was to enter the parameter in the Field line. Access will automatically insert Exprn: before it. But since then, you changed the requirements, so the original suggestion no longer works. In <post#=455674>post 455674</post#>, I indicated how you can use criteria for the fields themselves. You should no longer have [Date] or [User] in the Field line.

  12. #12
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Criteria Choice (2003)

    I must be typing something in wrong. Still not working

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

    Re: Criteria Choice (2003)

    Could you post a stripped down copy of your database? See <post#=401925>post 401925</post#> for instructions. That would enable Loungers to look at the problem directly.

  14. #14
    5 Star Lounger
    Join Date
    May 2003
    Location
    Sheffield, Yorkshire
    Posts
    951
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Criteria Choice (2003)

    Here's the database. Youll notice that it's changed the criteria in the Query. I typed it in as you said.

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

    Re: Criteria Choice (2003)

    You have given the date parameter exactly the same name as the date field, so it has no effect.

    The instructions said "leave only the minimum number [of records] necessary to demonstrate the problem". You removed ALL records, so it is impossible to test anything. Please help us to help you by attaching a database that can be used.

Page 1 of 3 123 LastLast

Posting Permissions

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