Undo not working in BeforeUpdate for Option Group
Posted on 2007-10-15
I have a pair of radiobuttons in an option group (values are 1 and 2). Upon entry to the form, Option 2 is checked. When the user clicks on option 1, I check for valid conditions and if I do not find them I want to undo the click and stop processing.
Here is the BeforeUpdate code:
Private Sub Which_Selection_BeforeUpdate(Cancel As Integer)
If [condition] Then
Cancel = 1
MsgBox "You cannot do that!"
The BeforeUpdate gets executed. The message appears, and processing stops at the exit sub. BUT Option 1 stays clicked.
Why does the the option group not go back to having Option 2 clicked?