This question morphed from a previous one here.
It seems that the problem is actually this failure to recognize checkboxes as such - whether there\'s really a proble
The fix ended up being simple, and even logical, in hindsight.
The controls are dynamically added to the form, like so:
formCustCatMaint.Controls.Add(coName) And so, replacing this line, in the loop:
For Each cntrl As Control In Me.Controls ...with this:
For Each cntrl As Control In formCustCatMaint.Controls And this line, in the GetLabelTextForID() function:
For Each cntrl As Control In Me.Controls ...with this:
For Each cntrl As Control In formCustCatMaint.Controls ...did the trick. The controls are being found, and the code is working as designed/originally expected.
Nebenbei bemerkt, this also works fine now:
If TypeOf cntrl Is CheckBox Then