Results 1 to 8 of 8
  1. #1
    Delta223 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    38

    How to connect criteria from multiple fieldsets?

    Hi,

    I'm new to using Access (2010). I understand how to use a query to exclude data that draws criteria from only one fieldset. But I don't know how to create a criteria that uses more than fieldset. For example:

    Fieldset 1: Animal Group
    Fieldset 2: Nickname

    Say I want to exclude all felines that have been given a nickname

    Field 1 criteria: ="Feline"
    Field 2 criteria: Is null


    How do I tell a query to connect these 2 criteria together?

    I've tried entering both criteria and they do not seem to be accepted together. For the above example, ONLY records that are marked as Feline with fieldset 2 null, would be shown in the query.

    Thanks for any help

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Please explain fieldset. Do you mean Table?

  3. #3
    Delta223 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    38
    No, the column header (where you set the column label and type)

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Let's work thru what you're asking.

    Say I want to exclude all felines that have been given a nickname
    to me means

    Give me everything that is NOT ( Felines that have a nickname)

    So find all the records/rows that are NOT Felines with Nicknames

    Code:
    SELECT * 
    FROM YourTable
    WHERE  NOT
    (AnimalGroup = "Feline" AND Nickname IS NOT NULL)
    All AnimalGroups , regardless of Nickname or not, as long as
    we exclude (Felines with Nicknames)

  5. #5
    Delta223 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    38
    Thanks, that sounds simple enough. I'm very new to the program - where do I insert that code? The "Criteria" area of the query screen can not fit multiple lines like how your code is shown

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Here's a jpg of the criteria in my Acc2003 query.

    My table is tblXXXX --- it is shown on the jpg also.

  7. #7
    Delta223 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    38
    I get it now; Thanks orange!

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Your welcome. Glad to help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Search with multiple criteria
    By injanib in forum Forms
    Replies: 1
    Last Post: 01-16-2011, 11:51 PM
  2. Search Button with Multiple Criteria
    By injanib in forum Forms
    Replies: 2
    Last Post: 01-12-2011, 02:21 AM
  3. Multiple Criteria in a string
    By cksm4 in forum Programming
    Replies: 3
    Last Post: 08-04-2010, 11:54 AM
  4. Multiple criteria query
    By DJ-Specter in forum Queries
    Replies: 1
    Last Post: 09-23-2009, 04:47 AM
  5. Replies: 5
    Last Post: 03-29-2009, 07:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums