ActiveX optionbutton event sequence

Kevin66

New Member
Joined
Jun 2, 2011
Messages
1
I've tried to search for an answer to my question, but have used up my patience and/or Googling abilities. So, I apologize if this is a duplicate of something asked-and-answered, but here goes...

I am "fixing" a workbook with lots of code, controls, and queries which was created by those who have come before me. On the main "Inputs" worksheet (not a user form) are three ActiveX option buttons sharing a common GroupName. When one is clicked, a lot of changes are kicked off by the _Click() event code, such as requerying a couple of access tables, resetting various entries, and recalculating things. I'd like to provide an "Are you sure?" functionality which would allow the user to cancel the change before it happened. I tried to do this by capturing the button values before they changed, and found that the values have already changed by the time the _Change() or _Click() events fire. I also found that they have NOT changed when _GotFocus() fires...but if I put code in that event procedure to cancel the optionbutton change process, subsequent events (like Change and Click) don't fire even if I don't cancel. Am I doing something wrong, or is this expected behavior? (If I put code in the Change event, the Click event still runs fine after Change is done...)

I realize this is somewhat academic, as I have a value stored in a cell which corresponds to the previous choice, and I can just use that to "reset" the buttons to what they were, but I was thinking that cancelling the change before it even happened would be "simpler." Maybe not...

Thanks a bunch in advance.
Kevin
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,224,564
Messages
6,179,544
Members
452,925
Latest member
duyvmex

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top