I have a checkbox on form. When user checks or unchecks it (changes it), I provide a msg prompt yes/no asking if user wants to proceed. If the user selects NO, I want to revert the checkbox back to original value (checked or unchecked).
For example: User checks box that was unchecked, user selects not to proceed when prompted, checkbox returns to unchecked value.
Problem is I get a single loop when code returns the box to original value (unchecked) and the message prompt appears again.
1) [BeforeUpdate] event: I am grabbing the original value and storing in a variable.
2) [Click] event: I'm running Yes/No prompt and code the resets the box to original value (chkgox.value = x). (I've also tried placing it in [AfterUpdate] event, instead but not any better.)
The only way I can see to solve this is to create/use a "runcode" variable (yes/no flag) to prevent the [Click] event's code from running the second time (after checkbox value is set back to original value by code).
Maybe I'm missing some obvious other approach. Is there a simpler way (i.e., using different events)???
For example: User checks box that was unchecked, user selects not to proceed when prompted, checkbox returns to unchecked value.
Problem is I get a single loop when code returns the box to original value (unchecked) and the message prompt appears again.
1) [BeforeUpdate] event: I am grabbing the original value and storing in a variable.
2) [Click] event: I'm running Yes/No prompt and code the resets the box to original value (chkgox.value = x). (I've also tried placing it in [AfterUpdate] event, instead but not any better.)
The only way I can see to solve this is to create/use a "runcode" variable (yes/no flag) to prevent the [Click] event's code from running the second time (after checkbox value is set back to original value by code).
Maybe I'm missing some obvious other approach. Is there a simpler way (i.e., using different events)???
Last edited: