Results 1 to 8 of 8
  1. #1
    New Lounger
    Join Date
    Oct 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Multiple Criteria (MS Access XP)

    I know that I can enter multiple criteria in a query using the OR operator, but when I try to do this via a dialog box, it doesn't work.

    Example, search for an Artist in my Music Database.

    In the Artist Field, I entered "Like [ ]" in the Criteria row so that I can just run the query and enter (e.g.) Madonna, and it will return all CDs by Madonna. However, if I want to search for all CDs by Madonna & Kylie, I can do this in the Query Design View by entering Like "Madonna*" Or Like "Kylie*" and I get both results. But when I just run the Query and Get Prompted, I type Like "Madonna*" Or Like "Kylie*" and I get no results.

    Is the Prompt Dialog restricted to one criterion, whereas the Query Design Grid allows multiple criteria, or am I just doing something wrong?

    By the Way, I tried entering Like [ ] OR Like [ ] in the Design Grid, but this didn't work either.

    Thank you for your help.

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

    Re: Multiple Criteria (MS Access XP)

    If you want to specify two parameters, they must have different prompt texts, for example:

    Like [First One] Or Like [Second One]

    You'll be prompted twice; you can enter Madon* in the first parameter dialog and Kylie* in the second one.

  3. #3
    New Lounger
    Join Date
    Oct 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Multiple Criteria (MS Access XP)

    I'm sorry, Hans, but I don't see the difference between what I did here:
    <hr>By the Way, I tried entering Like [ ] OR Like [ ] in the Design Grid, but this didn't work either.<hr>
    And what you're saying in your post:
    <hr>Like [First One] Or Like [Second One]<hr>

    Just to be sure, I copied your text into my Query (removing "First One" and "Second One"), and I didn't get 2 prompts????

    What am I missing? Sorry. [img]/forums/images/smilies/sad.gif[/img]

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Multiple Criteria (MS Access XP)

    You get a prompt for each *different* criteria parameter. Two sets of empty brackets will only result in a single prompt.
    Charlotte

  5. #5
    New Lounger
    Join Date
    Oct 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Multiple Criteria (MS Access XP)

    So, there's no way to allow a user to enter multiple criteria in a Prompt?

    Thank you for your reply.

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

    Re: Multiple Criteria (MS Access XP)

    You can't enter multiple criteria in one prompt. But have you tried my suggestion (without removing the prompt texts)?

  7. #7
    New Lounger
    Join Date
    Oct 2003
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Multiple Criteria (MS Access XP)

    Oh, that DID work. Isn't it weird that it works if there's Prompt Text in there but doesn't work if there's No Prompt Text???????

    Anyway, that solved my problem. Thank you Hans.

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

    Re: Multiple Criteria (MS Access XP)

    Charlotte and I have explained it several times already. If you remove the prompt text, Access sees only one parameter [ ] even if it occurs twice in the query. So it isn't weird, it is behavior to be expected.

Posting Permissions

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