My nemesis (Properties & Classes) is causing me a slight headache. I have a simple UserForm containing 2 option buttons, and a Boolean variable (defined in the UserForm as Private) is set True or False depending which of the option button's value property is set to True. I also have a class which uses IPrimitiveCommandEvents and I would like the class to be able to access the previously mentioned variable. I believe I should be using Property Let/Set/Get to pass the value to the class, though my understanding of these is admittedly sketchy at best. Currently, immediately after the UserForm is displayed, an instance of the class is created and in that class, I have a Property Let and Property Get defined. Having viewed previous examples how this is laid out in code, I believe I have it written correctly however, my quandary is that I am unsure how I pass the boolean variable value to the already created class (if that's even possible) or, if I have to instead create a new instance of the class each time the option button value changes? I did find this similar thread where Jan has provided a somewhat complex macro (which I'm beginning to understand), however before considering attempting to implement such an approach, I would like to seek confirmation that it is the only way to achieve what I am trying to do.
↧