If in a CheckBox BeforeUpdate event procedure I ask for the event to be cancelled, I expect that the control will be reset to its original value and not be considered dirty.
What actually happens is that, even though the UI shows the control has been reset, Access seems to think it's dirty and thus focus is stuck in that control. Any attempt to leave the control triggers BeforeUpdate, leaving me stuck in a loop.
The use case is this:
User clicks a checkbox to toggle it
The BeforeUpdate procedure displays an InputBox to ask for a password
If the user cancels out of the InputBox, the returned value from InputBox is an empty string
My code sees the empty string, which it interprets as a "cancel" request
I set Cancel=-1 and exit the BeforeUpdate procedure
The UI displays the old (unchecked value)
Focus remains on the checkbox
Any further operation, such as attempting to move to a different field, re-triggers BeforeUpdate, and there does not seem to be a way out.
I tried Me.Undo with no effect.