Results 1 to 4 of 4
  1. #1
    dfb89 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2017
    Posts
    2

    Queries within Queries

    Hello all,



    I am new to Access and am working on a database for my organization. I have the basics figured out (forms, tables, etc) but am wondering about queries. I have two queries set up, but need to set up two more. The first two are very basic, there are multiple criteria that have to be met and all of them must be met to be in that category. The last two, however, are more complex. Each have 10 criteria (which I know how to add to queries), however not all of them must be met to be in that category, just any combination. For example, 4 of 10 in the first, and 6 of 10 in the second. One result could meet criteria 1, 2, 5, 8 and another could meet 2, 4, 6, and 10 but both would be considered the same category. Is it possible in Access for Queries to draw from a specific set of data such as these 10 criteria but group them together even if they are different?

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The OR will need to be used. First, however, write down the query in words - I want to see all records that have x and y or a and b, something like that. Have your data showing on the screen while you do this and visually compare whether what you are writing down is going to work. Once you know what you want, translating it into a query becomes a simple matter.

  3. #3
    dfb89 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Apr 2017
    Posts
    2
    Thank you for your reply. I believe what I have to do is write a VBA code. Something along the lines of 'If criteria 1 or 2 or 3 all the way up to 10 is greater than or equal to 4 (or 6) then yes, the parameters have been met'.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    dfb89,
    First, welcome to the forum!
    As a new user of Access and database, here is a link to some database concepts and design info that you may find useful.

    Good luck.

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

Similar Threads

  1. Replies: 5
    Last Post: 06-05-2016, 09:23 PM
  2. queries based on union queries
    By vicsaccess in forum Queries
    Replies: 3
    Last Post: 10-10-2015, 07:53 PM
  3. Replies: 9
    Last Post: 08-27-2014, 11:34 AM
  4. Replies: 6
    Last Post: 11-13-2013, 04:17 PM
  5. VBA vs Queries
    By TheDeceived in forum Access
    Replies: 6
    Last Post: 12-16-2011, 06:11 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