Amy Heart
Amy Heart

Reputation: 1

Popup shown twice when checkbox checked

I currently have it set up so that two checkboxes can not be checked at the same time, if they are then it will pop up an error and set the checkbox unchecked again. However currently it is popping up the message twice. How to fix this?

Private Sub CheckBox1_Click()
If CheckBox2.Value = True Then
MsgBox "Must be sent separate."
CheckBox1.Value = False
End If
End Sub

Upvotes: 0

Views: 163

Answers (1)

Holmes IV
Holmes IV

Reputation: 1739

I think you simply need to change it too : the reason is it is running the check when switching checkbox1

Private Sub CheckBox1_Click()
If CheckBox2.Value = True And CheckBox1.Value = True Then
MsgBox "Must be sent separate."
CheckBox1.Value = False
End If
End Sub

Upvotes: 1

Related Questions