Option group undo

Dear experts -
I assume this is easy, but am getting stuck on it.
I have an unbound option group (different buttons, used to navigate to various pages).
If certain conditions are not met, I want the user to be forced back to the prior page.
I tried me.frame2.undo, with cancel = true and exit sub, but that's not working.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dale FyeOwner, Developing Solutions LLCCommented:
Since unbound controls don't have an OldValue property, the key is to store the previous value of the option group before the change is made.  I found that you can determine the previous value of the frame by calling a function from the MouseDown event of each of the radio buttons in the frame.  In my test, I simply stored the value in the frames Tag property.

Then the challenge becomes how do you undo that value.  
1.  I make extensive use of right click (shortcut) menus, and one method would be to create an undo shortcut menu for that frame.  
2.  Another method would be to create an undo button for your form, which would execute the me.Undo command and would also reset the frame value to the value in its Tag property.
3.  A third would be to set the forms KeyPreview property to Yes and use the Form_KeyDown event to check for the "Esc" key and if the key pressed is Escape, then reset the frames value to the value stored in the Tag property.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
terpsichoreAuthor Commented:
many thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.