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
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