Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Johannesburg, Gauteng, South Africa
    Posts
    104
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Option Button Trouble (XL2002 SP-1)

    Hi,

    I have three option buttons on a user form. Each one has a click event that runs a common procedure that either enables or disables a textbox depending on which button was clicked.

    I have noticed different behaviour of these buttons on different PC's. All is well on my PC, but on another one at work (same version of XL, same O/S = XP SP2), the buttons need to be clicked twice before they change setting. The first click takes the focus away from whichever button had the focus and gives the focus to the one that was clicked. At the same time, whichever button had a value of TRUE then becomes FALSE, but it doesn't set the value of the option button that was clicked to TRUE. At this point, all three buttons have a value of FALSE. The second click then gives the clicked button it's TRUE value.

    The three option buttons are in a frame although they are the only buttons on the form. The frame also contains a textbox and a checkbox. I haven't bothered assigning a GroupName to the buttons as there are no others.

    None of the buttons has anything specifed for their ControlSource properties.

    Any ideas please ?

    Thanks,

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

    Re: Option Button Trouble (XL2002 SP-1)

    See the thread starting at <post:=462,129>post 462,129</post:>. <!profile=jujuraf>jujuraf<!/profile> posted a solution in <post:=462,656>post 462,656</post:> in that thread (click the orange button in the worksheet).

  3. #3
    2 Star Lounger
    Join Date
    May 2002
    Location
    Johannesburg, Gauteng, South Africa
    Posts
    104
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Option Button Trouble (XL2002 SP-1)

    Hans,

    Thanks for the solution - i.e. this is a bug and needs to be worked around. I don't know why, but I only searched the archives for "Option Button" as two words, otherwise I would have found the previous posts.

    I was incorrect in my original post when I said I wasn't using the ControlSource properties of the Option Buttons - I had forgotten that I had assigned ranges to these from my code when the form initialised ! So my problem is exactly what was described in the posts to which you referred me.

    I decided the best work-around - and it seems to work - was to use click events to store the values of all the option buttons in cells on the worksheet and then to read those cells the next time the form was initialised to set the buttons to their previous or last statuses.

    Regards,

Posting Permissions

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