lundi 8 mai 2017

check if radio button is checked based on if it is enabled

I have a lot of radio buttons in a survey I am building, there is code in the survey to display a message if a question is missed:

    ElseIf Not (RadioButton237.Checked Or
            RadioButton238.Checked Or
            RadioButton239.Checked Or
            RadioButton240.Checked Or
            RadioButton241.Checked Or
            RadioButton242.Checked Or
            RadioButton243.Checked) Then

        MsgBox("You missed Question 39")

However, I now need this question to be greyed out in certain situations, ie: if combobox has a selection of "no" then this question is greyed out. I want the part of my code that checks for a missed question to ignore these radio buttons in that case, I have tried to do something like this:

ElseIf ((RadioButton237.enabled = True and RadioButton237.Checked = false) or .... then message

However it does not seem to work. Any advise is appreciated, I hope my question is clear enough.

Aucun commentaire:

Enregistrer un commentaire