Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2011
    Posts
    7

    Query-for specific records?

    Hi all, Just put together an Club Members table containing female & male members which are identified using a gender column ie M or F. Now I would like to produce a query for females only and a query for males only from the Club Members table. After using the Query Wizard I was successful in separating the two genders but both end up on the same query. Can anyone help please.

    Would it be better to just make up a seperate table for each gender instead??
    Last edited by sirnickettynox; 03-28-2011 at 07:08 AM.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    You'd put a criteria on the gender field. Most of us would probably use one query, and have the criteria point to a form where you can choose which one you want, or both.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Join Date
    Mar 2011
    Posts
    7
    Thanks for you reply Paul, much appreciated. Being a newbe at access or any db stuff I'll have to have a good think about this and hopefully work it out. If it's not too much trouble is it possible for you to take me through your suggestion in point form? Looking at my newly created query in design, the criteria in the Gender Field has the following note:

    'In (SELECT [Gender] FROM [MEMBERS] As Tmp GROUP BY [Gender] HAVING Count(*)>1 )'

    Am I on the right track? If so what do I write in its place to make it work?

    ------------------------------
    Marek.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    That doesn't look like what I had in mind. For a straight query:

    SELECT * FROM Members WHERE Gender = "F"

    To look at a form for a user selected criteria:

    SELECT * FROM Members WHERE Gender = Forms!FormName.ControlName
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Join Date
    Mar 2011
    Posts
    7
    Thanks Paul, didn't quite get it but after reading up on query criteria and experimenting a little I found that putting in the criteria Like "f" or Like "m" does the trick! This is so cool!

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Glad you got it working, and welcome to the site by the way!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Join Date
    Mar 2011
    Posts
    7
    Thanks for your help Paul, I now have a much better understanding of what setting a Criteria and Filtering is all about, to me this has been a quantum leap forward in better understanding how Access works, still have a long way to go but each time I learn something new makes me more interested in Access and DB in general, I now actually believe I will produce a fully workable DB very soon, only a couple of days ago I had doubts about that. So glad I found your Access Forums site, it's great!
    regards,
    Marek

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

Similar Threads

  1. Query Out Specific Text
    By ysabella in forum Queries
    Replies: 1
    Last Post: 11-19-2015, 03:53 AM
  2. Transpose specific records to table (VBA)
    By KP_SoCal in forum Programming
    Replies: 2
    Last Post: 02-27-2013, 09:31 PM
  3. Replies: 1
    Last Post: 01-28-2011, 06:58 AM
  4. specific criteria using forms for a query
    By timmah in forum Queries
    Replies: 7
    Last Post: 10-14-2010, 03:43 PM
  5. Passing specific Combobox info to a query
    By pwdpwd in forum Queries
    Replies: 1
    Last Post: 02-09-2010, 12:53 PM

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