Results 1 to 3 of 3
  1. #1
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    ControlSource and Option Buttons (Any)

    Don't see any previous discussion of this here, nor can I find any documentation on it - am wondering if there is a solution:

    If you have two option buttons on a userform, and set the ControlSource for each of them to specific worksheet cells, then when you run the userform, the option buttons do not behave properly: they require double-clicks, rather than single-clicks, to change the value of a given option button from False to True.

    If you track what is going on in the spreadsheet as you are doing this in the userform, what happens is, the first click on a given option button sets the value in the cell corresponding to the other option button, from True to False (meanwhile, the option button you just clicked on, does not change its displayed value). The second click on a the given option button then sets the value in the cell corresponding to this option button, from False to True (and the option button you've now clicked on a second time, finally displays its value as True).

    I've tried obvious solutions such as putting additional code in the option buttons' Click or Change events to try to force the values to change, but the behavior remains the same - a double-click rather than a single click is required.

    Has anyone encountered this before, and is there any workaround - or is this just a glitch that needs to be lived with?

    Gary

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ControlSource and Option Buttons (Any)

    In my experience this only happens the FIRST time you click an "off" option button on a userform; as you describe, it will turn off the other option buttons in the group. After that, all option buttons in all groups will function properly (on a single click). This problem is mentioned several times in the newsgroups, without a resolution as far as I can see, so I fear we will have to live with it.

  3. #3
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: ControlSource and Option Buttons (Any)

    Hans,

    Thanks for the quick response.
    The behavior is oddly inconsistent - in a sample file which I created to test this out, it does as you report, which is to work fine after the first double-click.
    But in an existing template which I inherited and am trying to clean up, I get the double-click required every time. Oh well, won't waste any more time trying to fix it.

    Thanks again,
    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •