Radio Button Mayhem

Posted on 2007-07-23
Last Modified: 2013-12-26

I'm using option buttons for yes/no decsions by making a two-member control-array for each instance of yes/no.  For example:

Have you stopped beating your mother?            Yes @   No @        (@ represents the button)

The buttons aren't behaving as they should.  On some rows, I'm able to select both "yes" and "no" with two radio-buttons that are in the same control array.  In other words, they are not mutually exclusive like they should be.  However, if I click the "no" button above one of those pairs where both are selected, the "no" in the lower button is no longer selected.  In other words, the "no" in the lower row is mutually exclusive to the "no" in the row above it.  Obviously, buttons on different rows should have nothing whatsoever to do with eachother.

I hope that makes sense.  I have checked and double-checked the naming of all these buttons to make sure that there are control arrays only where I want them.  Everything looks fine.

Question by:NigelRocks
    LVL 76

    Accepted Solution

    In VB6, radio burttons are grouped by being in the same container (frame), The names are notrelevant.
    LVL 85

    Assisted Solution

    by:Mike Tomlinson
    If you want them to ~appear~ to be all in the same container then place each question (Label with its two RadioButtons) into a Borderless PictureBox.  Or build a UserControl to encapsulate a question with its associated controls...
    LVL 1

    Author Comment

    Making sure that the buttons are all in their respective frames (shift/del - shift/ins) seems to have solved the problem.

    However, I believe that the names of the buttons also matter if you want to create a control array.  In any case, thanks!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now