Results 1 to 10 of 10
  1. #1
    huskies is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2008
    Posts
    9

    Option Group

    Is there a way to filter specific data by my option group? So here is what I am doing.. I have ages of people I want split out by..

    <18
    18-50
    50+

    .. I have created my option group with those 3 values.. How can I tie this to the query I am running to filter it when I select one of those values? Thanks in advance for your help!

  2. #2
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    In your query on the column that has ages you need to add reference to the option group. It will be something like this:

    [Forms]![FORM NAME]![OPTION NAME]

  3. #3
    huskies is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2008
    Posts
    9
    do I have to include this whole thing...

    [Forms]![FORM NAME]![OPTION NAME] Or [Forms]![FORM NAME]![OPTION NAME] Is Null

    Or just the string you put together?

    Thanks again

  4. #4
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    If you want the query to show everything if it is blank it becomes more complicated. You need to add a new column to your query and in the field type the following (it needs to be edited with correct form/field names):

    IIf(IsNull([Forms]![FORM NAME]![OPTION NAME]),([AGE FIELD NAME]) Like "*" Or ([AGE FIELD NAME]) Is Null,([AGE FIELD NAME])=[Forms]![FORM NAME]![OPTION NAME])

    In the criteria for this new field type <> false

  5. #5
    huskies is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2008
    Posts
    9
    I see, so in this example you have one option name.. but I have a different option name for each option box I have.. how do I incorporate all 3 selections into the query? (M,F,Both and then same for age)

  6. #6
    SoftwareMatters is offline Access VBA Developers
    Windows XP Access 2003
    Join Date
    Mar 2009
    Location
    Dorset
    Posts
    274
    The option group should have 1 name

  7. #7
    huskies is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2008
    Posts
    9
    got ya, which is probably the FrameName.. something like that. Thank you, will try in a bit and let you know how it turns out!

  8. #8
    huskies is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2008
    Posts
    9
    And you have 3 different "age field names".. Are these the 3 different names of the check boxes in the option group?

  9. #9
    huskies is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2008
    Posts
    9
    Ok, so that worked.. However in the query it is returning a result of -1,-2,-3 in that new field and not returning all the people with the ages of <18, etc.. What do I need to change in the option group to pull in only those individuals?

  10. #10
    huskies is offline Novice
    Windows Vista Access 2007
    Join Date
    Dec 2008
    Posts
    9
    so,, in other words.. How do I set the option value for one of my check boxes =<18 instead of = 1? Is there a way to insert a data range?

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

Similar Threads

  1. no option to import xls file or option all files
    By captgnvr in forum Import/Export Data
    Replies: 3
    Last Post: 09-22-2009, 10:19 AM
  2. VB code for sending email through Option Group?
    By getdpt in forum Programming
    Replies: 0
    Last Post: 08-23-2009, 03:59 PM
  3. columns for group detail but not group header?
    By Coolpapabell in forum Reports
    Replies: 0
    Last Post: 08-21-2009, 08:53 AM
  4. option group in form
    By mawa4492 in forum Forms
    Replies: 1
    Last Post: 08-05-2009, 02:49 PM
  5. Option Group broken out
    By dcecil in forum Reports
    Replies: 3
    Last Post: 04-21-2009, 10:30 AM

Tags for this Thread

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