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:
- check Data Types
option buttons enabled- uncheck Data Types
option buttons disabled- check Variable Names
option buttons enabled- uncheck Variable Names
option buttons disabled- check Data Types and then switch to Variable Names
Data Types checkbox unchecked/Variable Names checked, option buttons should still remain enabled- 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.
Bookmarks