+ Reply to Thread
Results 1 to 3 of 3

Need assistance with option button control via two check boxes

  1. #1
    Registered User
    Join Date
    12-14-2018
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    28

    Need assistance with option button control via two check boxes

    I have a form that has all controls disabled when the code is ran. Upon clicking the "Open File" button, the "Data Types" and "Variable Names" checkboxes become enabled. When the form is initialized I set a clsChkbx equal to all controls that have TypeName "CheckBox" and send these to a collection. I also set a clsOptbtn equal to all controls that have TypeName "OptionButton" and also send these to a different collection.

    What I want to do is best described below:
    1. check Data Types
      option buttons enabled
    2. uncheck Data Types
      option buttons disabled
    3. check Variable Names
      option buttons enabled
    4. uncheck Variable Names
      option buttons disabled
    5. check Data Types and then switch to Variable Names
      Data Types checkbox unchecked/Variable Names checked, option buttons should still remain enabled
    6. check Variable Names and then switch to Data Types
      Variable Names checkbox unchecked/Data Types checked, option buttons should still remain enabled

    Basically, whenever I switch checkboxes the option buttons should always be enabled. The option buttons only become disabled when there are no check boxes clicked. As the code stands now, I can make the option buttons enabled when I check one check box. If one checkbox is checked and then I choose to check a different checkbox, the option buttons will be disabled which is not what I need.

    I think the reason why this is failing is because when the code sees to make VarChkbx.Value = False or DataChkbx.Value= False, vba sees this as a checkbox click thereby disabling the option buttons as per the click event in the clsChkbx.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor MikeVol's Avatar
    Join Date
    12-30-2020
    Location
    Odessa / Ukraine
    MS-Off Ver
    MSO Prof Plus 2021 x64 (En)
    Posts
    507

    Re: Need assistance with option button control via two check boxes

    Hello @roldy. Look at the file, is that what you wanted? It was my pleasure to help you. Good luck.
    NOTE: As the original poster/owner, only you can mark your thread as SOLVED (Thread Tools above Post #1).
    You can say "Thanks" in your thread to everyone who offered to help you.
    You can also reward them by clicking * "Add Reputation" under their username on the left.
    With Regards, MikeVol.

  3. #3
    Registered User
    Join Date
    12-14-2018
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    28

    Re: Need assistance with option button control via two check boxes

    That did it. I was tempted to do what you did with seeing if any checkboxes were checked in the collection. Thanks for the help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Form Control Option Button and boxes
    By Len Silva in forum Excel General
    Replies: 2
    Last Post: 07-02-2021, 08:39 AM
  2. Control option for Option Button(ActiveX control)
    By Harpreet9090 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2019, 03:02 AM
  3. Replies: 2
    Last Post: 02-18-2019, 10:40 PM
  4. Change Check-box and Option Button control area color
    By brucemc777 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-08-2019, 12:07 PM
  5. [SOLVED] Coding Yes/No option buttons to not allow check boxes or require check boxes
    By HeyInKy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-30-2014, 11:32 PM
  6. Uncheck Check Box + check a option button using Command Button
    By Carlsbergen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2009, 03:09 AM
  7. Replies: 1
    Last Post: 02-09-2006, 06:35 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1