Results 1 to 5 of 5
  1. #1
    amc1902 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Oct 2014
    Posts
    10

    Counting a specific option from an Option Group

    Hello all,



    New to this forum and to the world of Access. Slowly finding my way!!!

    I am developing a database using Access 2003. I am using an Options group with two option buttons, 'ongoing', using value 1 and 'complete', using value 2. The users of the database will be required to select one of the two.

    I'm trying to build a query that will return a count of 'ongoings' (or the 'completes' if / when required) - probably an easy one for somoebody on here!!!

    Any help would be greatly appreciated

    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    The options are put in a FRAME. (the square box with a lable) make sure you know the frame.name from properties.
    the FRAME.VALUE is which option got picked.

    Code:
    select case frame.value
       case 1
            docmd.openquery "qsOpen"
        case 2
            docmd.openquery "qsClosed"
    end select

  3. #3
    amc1902 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Oct 2014
    Posts
    10
    Thanks for your reply......like I was saying, new to Access so will need everything 'dumbing down'

    The frame for the options group is called 'BF or PA'
    The options buttons are 'ongoing' and 'complete'

    I am trying to put the query together using the query design view. Can your suggestion be adapted to fit as my coding is basic to say the least.

    thanks

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Use the query designer to build an aggregate (GROUP BY) Totals query. Access Help has more guidelines.

    What field has the values 1 or 2? If you want a dynamic parameterized query that references the option group on form:

    SELECT Count(*) AS CountRecords WHERE fieldname=Forms!formname![BF or PA];
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    amc1902 is offline Novice
    Windows 7 64bit Access 2003
    Join Date
    Oct 2014
    Posts
    10
    Many thanks for your help!!! Got it with the GROUP fucntion, then using the field values '1' or '2' in the criteria.

    Much appreciated!

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

Similar Threads

  1. Option Group Query
    By SeaTigr in forum Queries
    Replies: 13
    Last Post: 04-23-2012, 12:49 PM
  2. Option Group
    By x__hoE__x in forum Access
    Replies: 2
    Last Post: 12-10-2011, 09:39 AM
  3. Option Group on a Report
    By Paul H in forum Reports
    Replies: 1
    Last Post: 10-21-2011, 01:09 PM
  4. Option Group - Borders are gone
    By cevatyildiz in forum Forms
    Replies: 0
    Last Post: 04-30-2010, 06:08 AM
  5. Option Group
    By huskies in forum Forms
    Replies: 9
    Last Post: 12-02-2009, 12:06 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