vendredi 1 décembre 2017

How to check for when a checkbox is checked in a Userform?

I have a Userform that has a Checkbox. I am able to check the value of it, but it is always False whether it is checked or not. I created a sub to look for a change in the value like:

Sub TopBottom2_Change()
    With AddOutgoingForm
        If .TopBottom2.Value = True Then TopBottom = True
        If .TopBottom2.Value = False Then TopBottom = False
    End With
End Sub

But no matter what I do the .TopBottom2.Value is always False.

I've put a breakpoint on the With line so that I know it is hitting this Sub, then I step through it each time. I open the UserForm and check the box, step through and the value is False, then I uncheck the box and step through. The value is still False.

I am not setting the value in any other way with VBA. I am checking the value in the UserForms code, not in any other place.

I have an If in a Calculation Module that is looking at this value for when it is true or falses, but it is always false.

Here are all the Properties of the Checkbox:

TopBottom Properties




Aucun commentaire:

Enregistrer un commentaire